Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 265f410

Browse filesBrowse files
fix: Swap writer and reader schema to correct places in sample (#1052)
* samples: schema evolution * Add command-line commands * Fix tag for rollback * Make formatting fixes * Formatting fixes * Fix exceptions * fix: Set x-goog-request-params for streaming pull request * Set blunderbuss config to auto-assign issues and PRs * fix: Swap writer and reader schema to correct places in sample
1 parent 062c132 commit 265f410
Copy full SHA for 265f410

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Collapse file

‎samples/snippets/schema.py‎

Copy file name to clipboardExpand all lines: samples/snippets/schema.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ def subscribe_with_avro_schema_with_revisions(
645645
subscription_path = subscriber.subscription_path(project_id, subscription_id)
646646

647647
with open(avsc_file, "rb") as file:
648-
writer_avro_schema = schema.parse(file.read())
648+
reader_avro_schema = schema.parse(file.read())
649649
# Dict to keep readers for different schema revisions.
650650
revisions_to_readers = {}
651651

@@ -665,7 +665,7 @@ def callback(message: pubsub_v1.subscriber.message.Message) -> None:
665665
print(f"{schema_path} not found.")
666666
message.nack()
667667
return
668-
reader_avro_schema = schema.parse(received_avro_schema.definition)
668+
writer_avro_schema = schema.parse(received_avro_schema.definition)
669669
revisions_to_readers[schema_revision_id] = DatumReader(
670670
writer_avro_schema, reader_avro_schema
671671
)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.