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

DEVC-627 | Handle optional data field #86

Merged
merged 5 commits into from
Feb 7, 2024

Conversation

vladbagmet
Copy link
Contributor

@vladbagmet vladbagmet commented Feb 5, 2024

Rationale

Some old apps send events with empty data field which causes error like this one.

Changes

Going forward, once event with empty data is received, no payload validation is raised.

DEVC-627

TODO

  • Update CHANGELOG.md

CHANGELOG.md Outdated Show resolved Hide resolved
@oleksii-symon-corva-ai
Copy link
Contributor

@ville We've added filtering to stream time events, do we need one for depth events too?


return values

@pydantic.validator("records", pre=True)
def validate_records(cls, v):
if isinstance(v, List):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it a good idea long-term to use typing.List in isinstance checks? Simple list might be more robust, especially, if we migrate to 3.9+

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But this change will break SDK for old Dev Center apps which are still on Python3.8 or am I missing anything?

Copy link
Contributor

Choose a reason for hiding this comment

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

It won't, e.g. below we use simple dict in isinstance check - same thing can be used here

Copy link
Contributor

@oleksii-symon-corva-ai oleksii-symon-corva-ai left a comment

Choose a reason for hiding this comment

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

🔥 Let's see, what Ville says, whether we need this for depth events too and merge!

@ville
Copy link

ville commented Feb 7, 2024

@ville We've added filtering to stream time events, do we need one for depth events too?

No need.

Copy link

@ville ville left a comment

Choose a reason for hiding this comment

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

LGTM

@vladbagmet vladbagmet merged commit 34387dc into master Feb 7, 2024
4 checks passed
@vladbagmet vladbagmet deleted the feature/DEVC-627_make_optional_data_field branch February 7, 2024 14:15
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.

5 participants