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

Refactor data serialization #2211

Merged
merged 5 commits into from
Oct 22, 2024
Merged

Refactor data serialization #2211

merged 5 commits into from
Oct 22, 2024

Conversation

therve
Copy link
Contributor

@therve therve commented Oct 12, 2024

Remove classmethod sanitize_for_serialization (moving all functionality to data_to_dict), and fix model_to_dict to use the same logic so that it handles list of list properly for example.

What does this PR do?

Additional Notes

Review checklist

Please check relevant items below:

  • This PR includes all newly recorded cassettes for any modified tests.

  • This PR does not rely on API client schema changes.

    • The CI should be fully passing.
  • Or, this PR relies on API schema changes and this is a Draft PR to include tests for that new functionality.

    • Note: CI shouldn't be run on this Draft PR, as its expected to fail without the corresponding schema changes.

Remove classmethod sanitize_for_serialization, and fix
model_to_dict to use the same logic so that it handles list of list
properly for example.
@therve therve requested a review from a team as a code owner October 12, 2024 14:56
Comment on lines +1414 to +1415
if not serialize:
return instance

Choose a reason for hiding this comment

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

🔴 Code Quality Violation

too many nesting levels (...read more)

Avoid to nest too many loops together. Having too many loops make your code harder to understand.
Prefer to organize your code in functions and unit of code you can clearly understand.

Learn More

View in Datadog  Leave us feedback  Documentation

Comment on lines +1402 to +1403
if not serialize:
return instance

Choose a reason for hiding this comment

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

🔴 Code Quality Violation

too many nesting levels (...read more)

Avoid to nest too many loops together. Having too many loops make your code harder to understand.
Prefer to organize your code in functions and unit of code you can clearly understand.

Learn More

View in Datadog  Leave us feedback  Documentation

@amaskara-dd amaskara-dd merged commit 5afd0ab into master Oct 22, 2024
13 checks passed
@amaskara-dd amaskara-dd deleted the therve/fix-model-to-dict branch October 22, 2024 15:19
github-actions bot pushed a commit that referenced this pull request Oct 22, 2024
* Refactor data serialization

Remove classmethod sanitize_for_serialization, and fix
model_to_dict to use the same logic so that it handles list of list
properly for example.

* pre-commit fixes

* pre-commit fixes

---------

Co-authored-by: ci.datadog-api-spec <[email protected]>
Co-authored-by: amaskara-dd <[email protected]> 5afd0ab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants