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

Json Decoder Code Cleanup #814

Merged
merged 4 commits into from
May 10, 2023

Conversation

micdavis
Copy link
Contributor

@micdavis micdavis commented May 9, 2023

  • cleaned up json decoder code

profiles = {CategoricalColumn.__name__: CategoricalColumn}
profiles = {
CategoricalColumn.__name__: CategoricalColumn,
BaseColumnProfiler.__name__: BaseColumnProfiler,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need to have a bigger discussion, but I'm not sure it is appropriate to decode an abstract class. I'm concerned this could cause bugs / problems if it tries to initialize an abstract class.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If we instead list all the non-abstract classes here, will it be able to load all of them?

@taylorfturner taylorfturner added the Work In Progress Solution is being developed label May 9, 2023

profile_class = profiles.get(class_name)
if profile_class is None:
raise ValueError(f"Invalid profiler class {class_name} " f"failed to load.")
else:
return profile_class(None)
Copy link
Collaborator

@JGSweets JGSweets May 9, 2023

Choose a reason for hiding this comment

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

We can remove the else here and move the return over an indent. Raising above would fail otherwise.

@micdavis micdavis changed the title Decode BaseColumnProfiler Json Decoder Code Cleanup May 10, 2023
@taylorfturner taylorfturner removed the Work In Progress Solution is being developed label May 10, 2023
@taylorfturner taylorfturner merged commit d9e1002 into capitalone:main May 10, 2023
5 checks passed
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.

None yet

3 participants