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

NIFI-4798 allow empty value for UpdateAttribute property #6585

Closed
wants to merge 1 commit into from

Conversation

markobean
Copy link
Contributor

Summary

There exists a validator for dynamic properties added to UpdateAttribute. This prevents the "Set empty string" checkbox from being used; it results in an invalid property. Removed the validator to allow more freedom in assigning attribute values for UpdateAttribute processor.

NIFI-4798

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using mvn clean install -P contrib-check
    • JDK 8
    • JDK 11
    • JDK 17

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

@joewitt
Copy link
Contributor

joewitt commented Oct 26, 2022

What is the intended outcome @markobean ? Is this because someone wants to wipe out an attribute value to empty string?

@markobean
Copy link
Contributor Author

Yes, the goal is to be able to have an attribute exist with no value (empty string) on a given flowfile. Honestly, I'm not sure how much this is used in production, but could be useful in debugging flows.

Copy link
Contributor

@NissimShiman NissimShiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice addition @markobean !

I've bumped into this issue a few times myself when setting up tests (i.e. not being able to set an empty value value for an attribute), but never followed up further, so thank you for the jira and PR!

Clean code and unit test.

Compiled code and tested with both a new attribute with an empty value as well as an existing attribute with an empty value (i.e. to replace value of existing attribute with an empty value) and both worked fine.

Thanks!

LGTM +1

@mattyb149
Copy link
Contributor

Reviewing...

@mattyb149
Copy link
Contributor

+1 LGTM, verified the intended behavior. Thanks for the fix! Merging to main

@mattyb149 mattyb149 closed this in 4e4f643 Nov 4, 2022
@markobean
Copy link
Contributor Author

Thanks @mattyb149 !

@markobean markobean deleted the NIFI-4798 branch November 4, 2022 17:36
lizhizhou pushed a commit to lizhizhou/nifi that referenced this pull request Jan 2, 2023
Signed-off-by: Matthew Burgess <mattyb149@apache.org>

This closes apache#6585
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants