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

Hackweek: Added Makefile entry to fetch schema; eliminate type errors #1198

Merged
merged 9 commits into from
Aug 4, 2020

Conversation

dbennett-sentry
Copy link
Contributor

No description provided.

@dbennett-sentry dbennett-sentry requested a review from a team as a code owner August 4, 2020 19:04
Copy link
Contributor

@fpacifici fpacifici left a comment

Choose a reason for hiding this comment

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

cool


if isinstance(message, dict):
# deprecated unwrapped event message == insert
action_type = ProcessorAction.INSERT
try:

Copy link
Contributor

Choose a reason for hiding this comment

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

intentional ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope.

@@ -228,7 +234,7 @@ def process_insert(
self.extract_common(processed, event, metadata)
self.extract_custom(processed, event, metadata)

sdk = data.get("sdk", None) or {}
sdk = data.get("sdk", None) or {} # type: ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

What was the issue here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"sdk" does not exists on the data object.

@fpacifici fpacifici changed the title Added Makefile entry to fetch schema; eliminate type errors Hackweek: Added Makefile entry to fetch schema; eliminate type errors Aug 4, 2020
@@ -273,15 +283,15 @@ def extract_common(

# Properties we get from the "data" dict, which is the actual event body.

received = _collapse_uint32(int(data["received"]))
received = _collapse_uint32(data["received"])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The extra int here is probably a bug as int(None) fails, _collapse_uint32(None) returns None, and the subsequent code checks for None

EventData = JSONSchema["schema/event.schema.json"]


class Event(TypedDict):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this class is duplicate of InsertEvent below. We should have only one.

@dbennett-sentry dbennett-sentry merged commit 0bfb660 into wip/jsonschema-mypy Aug 4, 2020
@dbennett-sentry dbennett-sentry deleted the dbennett/event-typing-1 branch August 4, 2020 21:49
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.

2 participants