-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
@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): |
There was a problem hiding this comment.
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+
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this 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!
No need. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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