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

Add logic to detect and handle circular loops, and optionally ignore deprecated fields #36

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

brendan-morin
Copy link

@brendan-morin brendan-morin commented Aug 4, 2022

Add options for creating spark struct to ignore circularly defined fields and/or deprecated fields. This PR is a no-op change, meaning existing behavior should not be impacted.

I was not able to get the tests up and running on my local fork (make gen and make test both gave errors), so these will need to have tests added to validate behavior is as expected. I was able to informally validate behavior is as expected in a notebook. You may also want to further configure logging, but I think that's out of scope for this PR.

It may be worth separating the recursive functionality of get_spark_schema from the public interface to avoid the need to surface _seen_descriptors publicly (e.g. keep the current entry point and hide the recursion behind something like _ get_spark_schema)

@brendan-morin
Copy link
Author

@crflynn Please let me know what your thoughts are on adding this functionality, or if there's any additional changes you'd like to see.

@crflynn
Copy link
Owner

crflynn commented Aug 23, 2022

We would probably want to change some things here since options was intended to be a dict of the kwargs of protobuf's MessageToDict. We could probably make the args more explicit.

I see you added logic to get_spark_schema but not to the parsers. Is there additional logic required there?

Also as you mention there are no tests. Getting set up should be straightforward if you have asdf and poetry. What issues are you experiencing?

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