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

fix(ingestion): dont crash on non-RecordSchema topics #2372

Merged
merged 1 commit into from Apr 10, 2021
Merged

fix(ingestion): dont crash on non-RecordSchema topics #2372

merged 1 commit into from Apr 10, 2021

Conversation

thomasplarsson
Copy link
Contributor

@thomasplarsson thomasplarsson commented Apr 9, 2021

Fixes: #2371

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable)

Copy link
Collaborator

@hsheth2 hsheth2 left a comment

Choose a reason for hiding this comment

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

LGTM - left a minor nit comment, but its not a show-stopper

if isinstance(parsed_schema, avro.schema.RecordSchema):
schema_convert_fn = _recordschema_to_mce_fields
else:
schema_convert_fn = _genericschema_to_mce_fields
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: is there a reason to create schema_convert_fn instead of simply calling the method and returning 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.

@hsheth2 Only that I wanted to follow the pattern above. Returning directly is indeed prettier.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah makes sense 👍

Copy link
Contributor

@shirshanka shirshanka left a comment

Choose a reason for hiding this comment

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

LGTM!

@shirshanka shirshanka merged commit 6610666 into datahub-project:master Apr 10, 2021
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.

Kafka ingestion crashes if top level type is not a "record" type.
3 participants