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

[BEAM-7530] allow read None bytes #8817

Merged
merged 1 commit into from Jun 14, 2019
Merged

[BEAM-7530] allow read None bytes #8817

merged 1 commit into from Jun 14, 2019

Conversation

Juta
Copy link
Contributor

@Juta Juta commented Jun 11, 2019

bugfix when reading None values from bigquery

Traceback (most recent call last):
  File "/mnt/c/Users/Juta/Documents/02-projects/apache/beam/sdks/venv/lib/python3.5/site-packages/apache_beam/runners/direct/executor.py", line 343, in call
    finish_state)
  File "/mnt/c/Users/Juta/Documents/02-projects/apache/beam/sdks/venv/lib/python3.5/site-packages/apache_beam/runners/direct/executor.py", line 383, in attempt_call
    result = evaluator.finish_bundle()
  File "/mnt/c/Users/Juta/Documents/02-projects/apache/beam/sdks/venv/lib/python3.5/site-packages/apache_beam/runners/direct/transform_evaluator.py", line 319, in finish_bundle
    bundles = _read_values_to_bundles(reader)
  File "/mnt/c/Users/Juta/Documents/02-projects/apache/beam/sdks/venv/lib/python3.5/site-packages/apache_beam/runners/direct/transform_evaluator.py", line 306, in _read_values_to_bundles
    read_result = [GlobalWindows.windowed_value(e) for e in reader]
  File "/mnt/c/Users/Juta/Documents/02-projects/apache/beam/sdks/venv/lib/python3.5/site-packages/apache_beam/runners/direct/transform_evaluator.py", line 306, in <listcomp>
    read_result = [GlobalWindows.windowed_value(e) for e in reader]
  File "/mnt/c/Users/Juta/Documents/02-projects/apache/beam/sdks/venv/lib/python3.5/site-packages/apache_beam/io/gcp/bigquery_tools.py", line 932, in __iter__
    row.f[i].v.string_value = row.f[i].v.string_value.encode('utf-8')
AttributeError: 'NoneType' object has no attribute 'string_value'

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- Build Status --- --- Build Status
Java Build Status Build Status Build Status Build Status
Build Status
Build Status
Build Status Build Status Build Status
Build Status
Python Build Status
Build Status
--- Build Status
Build Status
Build Status --- --- Build Status

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website
Non-portable Build Status Build Status Build Status Build Status
Portable --- Build Status --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

@Juta
Copy link
Contributor Author

Juta commented Jun 11, 2019

Run Python PostCommit

@Juta
Copy link
Contributor Author

Juta commented Jun 11, 2019

R: @tvalentyn

@Juta Juta changed the title [BEAM-6769] allow read None bytes [BEAM-7530] allow read None bytes Jun 11, 2019
@@ -928,7 +928,7 @@ def __iter__(self):
# return base64 encoded bytes as byte type on python 3
# which matches the behavior of Beam Java SDK
for i in range(len(row.f)):
if self.schema.fields[i].type == 'BYTES':
if self.schema.fields[i].type == 'BYTES' and row.f[i].v:
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks a lot! Could you please add to one of BQ IT tests a test scenario that reads and writes a row of None values for BQ datatypes that allow value to be None ?

Thank you!

@tvalentyn
Copy link
Contributor

We can merge this to make sure that 2.14 picks up the fix, but please add the missing test scenarios in a follow-up change. Thank you.

@tvalentyn
Copy link
Contributor

@pabloem could you please help with the merge?

@Juta
Copy link
Contributor Author

Juta commented Jun 12, 2019

Thanks @tvalentyn. I will add a test for this scenario next week

@tvalentyn
Copy link
Contributor

ping @pabloem :-)

@tvalentyn
Copy link
Contributor

tvalentyn commented Jun 13, 2019

@aaltay or @chamikaramj - Could you please help with the merge? Thanks!

@chamikaramj chamikaramj merged commit 82bf1ae into apache:master Jun 14, 2019
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.

None yet

3 participants