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

[WIP] Allow modification of data on [de]serialization #34

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

altendky
Copy link
Contributor

@altendky altendky commented Jan 6, 2020

#33

WIP for:

  • readme
  • [ ] docs
    • docstrings might cover this and the docs don't appear to be building properly at the moment
  • docstrings
  • 'direct' tests of new PolyFieldBase methods
  • tests moved to proper files
  • remove initial exploratory 'tests'
  • maybe expose ExplicitPolyField at the top level?
  • verify that the class to name mapping results in unique names for each class
  • implement something for a 'default' sort of class/schema mapping ala {str: fields.String, int: fields.Integer, ...}
  • it's late, i'm tired... i should at least review this myself another time
  • probably develop most of a PR for desert to test this out
  • consider and define and document inheritance situations
  • consider and define and document multiple inheritance situations

@altendky
Copy link
Contributor Author

altendky commented Jan 6, 2020

This is messy but I like to share sooner than later and I have someone specific to talk to about it. I'll note when I have some level of confidence that I like this.

@coveralls
Copy link

Coverage Status

Coverage decreased (-3.4%) to 96.591% when pulling 47f5dc4 on altendky:with_modification into 7f7567e on Bachmann1234:master.

@coveralls
Copy link

coveralls commented Jan 6, 2020

Coverage Status

Coverage remained the same at 100.0% when pulling aa6c2a6 on altendky:with_modification into 7b9548e on Bachmann1234:master.

@Bachmann1234
Copy link
Owner

Howdy! Im alive!

This is an interesting idea. Can you take a stab at a paragraph or two in the readme explaining the feature?

@altendky
Copy link
Contributor Author

altendky commented Jan 8, 2020

Sure thing, I added a list to the initial comment. If you have any design or API concerns along the way do bring them up. I'm not strongly settled on anything at this point.


top_class_str_example = TopClass(polyfield=u'abc')
top_class_str_example_dumped = top_schema.dump(top_class_str_example)
print(top_class_str_example_dumped)
Copy link
Owner

Choose a reason for hiding this comment

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

rather than printing I think you should validate the json that comes out with an assertion

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just exploratory code and I think it's fully replaced at this point by 'real' tests. It's in the WIP list to be removed.

top_class_str_example_loaded = top_schema.load(top_class_str_example_dumped)
assert top_class_str_example_loaded == top_class_str_example

print('---')
Copy link
Owner

Choose a reason for hiding this comment

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

Personally id rather you pull out what you need so you can make these two different tests rather than one test separated by the output

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Like above, to be removed.

@Bachmann1234
Copy link
Owner

So this looks pretty reasonable. PIng me when you think you have it at a state where its ready to merge!

@altendky
Copy link
Contributor Author

@Bachmann1234, it's not ready to merge but I have no particular outstanding issues on my list presently. So, it's at least worth a fairly real review I think. I may start into a PR against desert using this before really wanting to have this merged. It would be a good test of the implementation here and put me in a different seat looking at it.

@Bachmann1234
Copy link
Owner

This is looking pretty good. I think the conflicts are due to the PR dropping 27 so you may want to resolve that before any other tweaking

@altendky
Copy link
Contributor Author

Conflicts? It isn't complaining over here and I thought that c2dfa85 and 7d3a5e5 addressed the py2 removal.

@Bachmann1234
Copy link
Owner

Screen Shot 2020-01-20 at 10 01 03 AM

^^ What im seeing on the merge section (I know you still dont are not ready to merge but just letting you know)

@altendky
Copy link
Contributor Author

hmm... have you reloaded the page recently?

image

@Bachmann1234
Copy link
Owner

Ah, I figured it out. I'm defaulted to rebase and merge. That won't work due to conflcits. But I can squash and merge just fine

@altendky
Copy link
Contributor Author

Or, just merge? :] But sure, lots of personal preference to be had there.

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