Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update parameter value to null instead of delete #369

Merged
merged 3 commits into from
Jan 22, 2024

Conversation

juldrixx
Copy link
Contributor

@juldrixx juldrixx commented Jan 22, 2024

Q A
Bug fix? no
New feature? no
API breaks? no
Deprecations? no
Related tickets -
License Apache 2.0

What's in this PR?

Change in the logic of the parameter context updates.

Why?

If the value of parameter is deleted, the parameter shouldn't be deleted it should be set to null.

Additional context

Checklist

  • Implementation tested
  • Error handling code meets the guideline
  • Logging code meets the guideline
  • User guide and development docs updated (if needed)
  • Append changelog with changes

@juldrixx juldrixx requested review from erdrix and mh013370 January 22, 2024 15:10
@mh013370
Copy link
Member

Seems reasonable to me. Did deleting it cause a problem?

@juldrixx
Copy link
Contributor Author

Seems reasonable to me. Did deleting it cause a problem?

It wasn't logic. When you set:

  parameters:
    - name: toto
      description: titi

NiFiKop will create a parameter with a null value.

But if you had:

  parameters:
    - name: toto
      description: titi
      value: tata

and removed value: tata, NiFiKop deleted the parameter instead of setting it to null.

It was done in Orange-OpenSource/nifikop#162.

I think, back then, we couldn't set it to null with the API for some reason.

@juldrixx
Copy link
Contributor Author

Seems reasonable to me. Did deleting it cause a problem?

It wasn't logic. When you set:

  parameters:
    - name: toto
      description: titi

NiFiKop will create a parameter with a null value.

But if you had:

  parameters:
    - name: toto
      description: titi
      value: tata

and removed value: tata, NiFiKop deleted the parameter instead of setting it to null.

It was done in Orange-OpenSource/nifikop#162.

I think, back then, we couldn't set it to null with the API for some reason.

And yes deleting it cause a problem, because for some reason (didn't search why), the operator won't creating it back. So the dataflow will reference a parameter that doesn't exist and flag it as an error.

@mh013370 mh013370 merged commit 48b0376 into master Jan 22, 2024
5 checks passed
@juldrixx juldrixx deleted the update_parameter_value_to_null branch May 17, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants