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

Upgrade to Pydantic 1.9 to Support Delimiter Exclusion Via Model Config #35

Closed
dixonwhitmire opened this issue Aug 3, 2021 · 3 comments · Fixed by #113
Closed

Upgrade to Pydantic 1.9 to Support Delimiter Exclusion Via Model Config #35

dixonwhitmire opened this issue Aug 3, 2021 · 3 comments · Fixed by #113
Assignees

Comments

@dixonwhitmire
Copy link
Member

The upcoming Pydantic release, 1.9, will support adding export exclusions to Model Configuration class - pydantic/pydantic#660. This new feature will allow us to exclude the x12 "delimiters" from a model export using a single config.

This is an improvement over current functionality as we would need to exclude the delimiters in each "export" function ( dict(), json() etc) invocation.

@dixonwhitmire
Copy link
Member Author

Insight on the upcoming pydantic release . The maintainer is an individual that's a bit time constrained at the moment.
pydantic/pydantic#3228

@dixonwhitmire dixonwhitmire self-assigned this Dec 21, 2021
@dixonwhitmire
Copy link
Member Author

Pydantic 1.9 is now available

@dixonwhitmire
Copy link
Member Author

dixonwhitmire commented Jan 5, 2022

After reviewing the code it seems more appropriate to remove the delimiters from the X12Segment model, as they are metadata and not part of the data payload.

Changes include:

  • Removing the delimiters field from the base segment model
  • Adding a custom_delimiter parameter to the X12Segment.x12() method
  • Updating the X12 segment group to support a delimiters attribute

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 a pull request may close this issue.

1 participant