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

[MAINTENANCE] Ban future use of convert_to_json_serializable #9935

Merged
merged 3 commits into from
May 16, 2024

Conversation

Kilo59
Copy link
Member

@Kilo59 Kilo59 commented May 15, 2024

Use of convert_to_json_serializable is a sign that we aren't properly using pydantic models for objects that require json serialization.

Ban the import of the function and add # noqa: TID25 for existing violations.

Also ban ensure_json_serializable (maybe we don't care as much about this one?)

@Kilo59 Kilo59 self-assigned this May 15, 2024
Copy link

netlify bot commented May 15, 2024

Deploy Preview for niobium-lead-7998 canceled.

Name Link
🔨 Latest commit fec2dec
🔍 Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/664544ffed753300082dc41b

Copy link

codecov bot commented May 15, 2024

Codecov Report

Attention: Patch coverage is 96.42857% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 77.85%. Comparing base (499430b) to head (fec2dec).

Files Patch % Lines
...rule_based_profiler/helpers/runtime_environment.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #9935   +/-   ##
========================================
  Coverage    77.85%   77.85%           
========================================
  Files          454      454           
  Lines        39517    39517           
========================================
  Hits         30766    30766           
  Misses        8751     8751           
Flag Coverage Δ
3.10 64.39% <96.42%> (+0.01%) ⬆️
3.11 64.38% <96.42%> (ø)
3.11 athena or clickhouse or openpyxl or pyarrow or project or sqlite or aws_creds 53.62% <96.42%> (ø)
3.11 aws_deps 44.79% <96.42%> (ø)
3.11 big 53.84% <96.42%> (ø)
3.11 databricks 46.07% <96.42%> (ø)
3.11 filesystem 59.33% <96.42%> (ø)
3.11 mssql 49.06% <96.42%> (ø)
3.11 mysql 49.12% <96.42%> (ø)
3.11 postgresql 53.25% <96.42%> (ø)
3.11 snowflake 46.74% <96.42%> (+<0.01%) ⬆️
3.11 spark 56.52% <96.42%> (ø)
3.11 trino 51.16% <96.42%> (ø)
3.8 64.42% <96.42%> (ø)
3.8 athena or clickhouse or openpyxl or pyarrow or project or sqlite or aws_creds 53.62% <96.42%> (ø)
3.8 aws_deps 44.81% <96.42%> (ø)
3.8 big 53.85% <96.42%> (ø)
3.8 databricks 46.09% <96.42%> (ø)
3.8 filesystem 59.34% <96.42%> (ø)
3.8 mssql 49.04% <96.42%> (ø)
3.8 mysql 49.10% <96.42%> (ø)
3.8 postgresql 53.24% <96.42%> (ø)
3.8 snowflake 46.76% <96.42%> (ø)
3.8 spark 56.48% <96.42%> (ø)
3.8 trino 51.15% <96.42%> (ø)
3.9 64.41% <96.42%> (ø)
cloud 0.00% <0.00%> (ø)
docs-basic 47.62% <57.14%> (ø)
docs-creds-needed 48.74% <57.14%> (ø)
docs-spark 47.47% <57.14%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +424 to +425
"great_expectations.util.convert_to_json_serializable".msg = "Use pydantic for serialization."
"great_expectations.util.ensure_json_serializable".msg = "Use pydantic for serialization."
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if we care as much about ensure_json_serializable 🤷

@Kilo59 Kilo59 marked this pull request as ready for review May 15, 2024 23:28
Copy link
Member

@jcampbell jcampbell left a comment

Choose a reason for hiding this comment

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

Yes, this is what I had in mind!

@Kilo59 Kilo59 added this pull request to the merge queue May 16, 2024
Merged via the queue into develop with commit 8de0176 May 16, 2024
70 of 91 checks passed
@Kilo59 Kilo59 deleted the m/_/ban_convert_to_json_ser branch May 16, 2024 11:57
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

2 participants