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

Improve orjson compatibility #8767

Merged
merged 1 commit into from
Mar 5, 2021
Merged

Improve orjson compatibility #8767

merged 1 commit into from
Mar 5, 2021

Conversation

djova
Copy link
Contributor

@djova djova commented Mar 5, 2021

What does this PR do?

  • Fixes AttributeError: module 'orjson' has no attribute 'JSONEncoder' when importing datadog_checks.base.utils.db.statement_samples where orjson is installed.
  • Add datadog_checks_base json dependency to postgres tests so we're testing orjson correctly
  • Update statement sampler stub to serialize events to/from json to ensure we're testing the json serialization during integration tests.

Motivation

Fix broken import for DBM in case of orjson dependency being installed.

Additional Notes

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached

* Fixes `AttributeError: module 'orjson' has no attribute 'JSONEncoder'` when importing `datadog_checks.base.utils.db.statement_samples` where `orjson` is installed.
* Add `datadog_checks_base` `json` dependency to postgres tests so we're testing orjson correctly
* Update statement sampler stub to serialize events to/from json to ensure we're testing the json serialization during integration tests.
@ofek ofek changed the title datadog_checks_base: fix orjson bug Improve orjson compatibility Mar 5, 2021
@ofek ofek merged commit 1a894b2 into master Mar 5, 2021
@ofek ofek deleted the djova/postgres-fix-json branch March 5, 2021 15:30
djova added a commit that referenced this pull request Mar 5, 2021
Bump to new version containing this fix: #8767
ofek pushed a commit that referenced this pull request Mar 5, 2021
Bump to new version containing this fix: #8767
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.

2 participants