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

Fixes #18150 : change replaced dict by model_dump #18108

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

Conversation

kuma0128
Copy link
Contributor

@kuma0128 kuma0128 commented Oct 3, 2024

Describe your changes:

Fixes #18150

The dict method is deprecated; use model_dump instead. Deprecated in Pydantic V2.0 to be removed in V3.0

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

Copy link
Contributor

github-actions bot commented Oct 3, 2024

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@kuma0128 kuma0128 changed the title change replaced dict by model_dump Fixes #18104 : change replaced dict by model_dump Oct 3, 2024
@sushi30 sushi30 added the safe to test Add this label to run secure Github workflows on PRs label Oct 7, 2024
@sushi30 sushi30 self-assigned this Oct 7, 2024
Copy link
Contributor

github-actions bot commented Oct 7, 2024

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@kuma0128 kuma0128 changed the title Fixes #18104 : change replaced dict by model_dump Fixes #18150 : change replaced dict by model_dump Oct 7, 2024
Copy link

sonarcloud bot commented Oct 9, 2024

Quality Gate Passed Quality Gate passed for 'open-metadata-airflow-apis'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@@ -166,7 +166,7 @@ def get_columns(self, connection, table_name, schema=None, **kw):
if col_type in {"array", "struct", "map"}:
col_name = f"`{col_name}`" if "." in col_name else col_name
try:
rows = dict(
Copy link
Contributor

Choose a reason for hiding this comment

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

@kuma0128 I don't think we need to replace these once. this is python native dict and not pydantic dict. The pydantic dict would be something like PydanticModel.dict()

Copy link
Contributor

@TeddyCr TeddyCr left a comment

Choose a reason for hiding this comment

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

@kuma0128 we just need to replace the dict method of a Pydantic model not the python native dict

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test Add this label to run secure Github workflows on PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace dict of pydantic v1 to model_dump of pydantic v2
3 participants