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

Fix #386 Option to add .ignorePropery() to Csv builder #418

Closed
wants to merge 9 commits into from
Closed

Fix #386 Option to add .ignorePropery() to Csv builder #418

wants to merge 9 commits into from

Conversation

djay-S
Copy link

@djay-S djay-S commented May 1, 2023

Added new method CsvSchema.ignoreProperty() to define the properties that need to be removed for the csv.
Issue: #386

Added new method CsvSchema.ignoreProperty() to define the properties that need to be removed for the csv.
@djay-S
Copy link
Author

djay-S commented May 9, 2023

Updated the feature branch with the latest code corrections from the base branch.

@cowtowncoder cowtowncoder added the cla-needed PR looks good (although may also require code review), but CLA needed from submitter label Jul 28, 2023
@cowtowncoder
Copy link
Member

@djay-S I may be wrong, but I suspect this does not quite do what #386 is asking: I think it asks for something that would work similar to how @JsonIgnore works on POJO, but defined via schema. This PR on the other hand simply removes column definition which has other side effects.

But I hope @membersound can clarify details of how he thinks feature should work.

@djay-S
Copy link
Author

djay-S commented Aug 5, 2023

@cowtowncoder I have made changes for not removing the column definitions and only ignoring the columns. Let me know if the changes are valid.

@membersound
Copy link

@djay-S I may be wrong, but I suspect this does not quite do what #386 is asking: I think it asks for something that would work similar to how @JsonIgnore works on POJO, but defined via schema. This PR on the other hand simply removes column definition which has other side effects.

But I hope @membersound can clarify details of how he thinks feature should work.

Exactly: I simply need a method that behaves like @JsonIgnore, but without having to tough the target bean codewise.

* @param ignoreProperties Array of column names to be ignored by the csv builder
* @return A newly built {@link CsvSchema} with the ignored properties
*/
public CsvSchema ignoreProperty(String[] ignoreProperties) {
Copy link
Member

Choose a reason for hiding this comment

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

From naming perspective it should probably be "ignoreProperties".

Also, would perhaps make sense to take String... instead of String[] for convenience.

@cowtowncoder
Copy link
Member

@djay-S My concern is whether this does what is being requested, and from @membersound 's comment I suspect it does not: removing column from CsvSchema is different from having column in schema but ignoring it for deserialization.
Tests just check that columns are removed from CsvSchema but not behavior wrt using such schema.
I assume behavior for removed columns will be "No such property" wrt deserialization.

@membersound you may be able to try this out by building 2.16.0-SNAPSHOT locally from this PR, in case you think this might work.

Leaving this open for now but may close in future unless it is thought to actually solve the problem.

@cowtowncoder cowtowncoder removed the cla-needed PR looks good (although may also require code review), but CLA needed from submitter label Nov 21, 2023
@cowtowncoder
Copy link
Member

I don't think this makes sense, closing.

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.

3 participants