Skip to content

Conversation

@TheNeuralBit
Copy link
Member

Fixes #22854

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI.

@TheNeuralBit
Copy link
Member Author

R: @chamikaramj

@github-actions
Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

@codecov
Copy link

codecov bot commented Aug 25, 2022

Codecov Report

Merging #22899 (dc8408d) into master (3ede5b7) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master   #22899      +/-   ##
==========================================
+ Coverage   73.69%   73.72%   +0.03%     
==========================================
  Files         713      714       +1     
  Lines       94988    95393     +405     
==========================================
+ Hits        69998    70332     +334     
- Misses      23689    23760      +71     
  Partials     1301     1301              
Flag Coverage Δ
python 83.51% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sdks/python/apache_beam/typehints/row_type.py 100.00% <100.00%> (+2.98%) ⬆️
sdks/python/apache_beam/typehints/__init__.py 77.77% <0.00%> (-22.23%) ⬇️
...thon/apache_beam/ml/inference/pytorch_inference.py 0.00% <0.00%> (ø)
...apache_beam/typehints/pandas_type_compatibility.py 94.95% <0.00%> (ø)
sdks/python/apache_beam/runners/common.py 88.71% <0.00%> (+0.12%) ⬆️
sdks/python/apache_beam/transforms/util.py 96.22% <0.00%> (+0.15%) ⬆️
sdks/python/apache_beam/dataframe/schemas.py 97.88% <0.00%> (+0.20%) ⬆️
...eam/runners/interactive/interactive_environment.py 92.02% <0.00%> (+0.30%) ⬆️
...eam/runners/portability/fn_api_runner/execution.py 93.08% <0.00%> (+0.64%) ⬆️
sdks/python/apache_beam/utils/interactive_utils.py 97.56% <0.00%> (+2.43%) ⬆️
... and 3 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@chamikaramj chamikaramj left a comment

Choose a reason for hiding this comment

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

Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you clarify why we need to make this a callable for Python to recognize it as a type (may be also update the comment here) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if there's a better reference on this, but the CPython implementation explicitly considers anything that's callable a type:
https://github.com/python/cpython/blob/d348afa15d5a997e7a8e51c0f789f41cb15cc651/Lib/typing.py#L137-L167

Copy link
Member Author

Choose a reason for hiding this comment

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

It looks like this is actually being relaxed in Python 3.11: python/cpython@870b22b#diff-ddb987fca5f5df0c9a2f5521ed687919d70bb3d64eaeb8021f98833a2a716887

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. Optionally, add a comment that this can be removed after we are fully in Python 3.11 (whenever that is).

@TheNeuralBit
Copy link
Member Author

Run Python PreCommit

Copy link
Contributor

@chamikaramj chamikaramj left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. Optionally, add a comment that this can be removed after we are fully in Python 3.11 (whenever that is).

@chamikaramj
Copy link
Contributor

@TheNeuralBit Can this be merged ?

@TheNeuralBit
Copy link
Member Author

@TheNeuralBit Can this be merged ?

Let me add a comment with an explanation, then I will self-merge. Thanks!

@TheNeuralBit
Copy link
Member Author

Run Python PreCommit

1 similar comment
@TheNeuralBit
Copy link
Member Author

Run Python PreCommit

@TheNeuralBit TheNeuralBit merged commit b8ca081 into apache:master Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Type inference failing for Python SDK with External transforms and beam.Row

2 participants