Skip to content

Make RowTypeConstraint callable, test nested optional row in schemas and RowCoder - #22899

Merged
TheNeuralBit merged 4 commits into
apache:masterfrom
TheNeuralBit:nested-row
Sep 1, 2022
Merged

Make RowTypeConstraint callable, test nested optional row in schemas and RowCoder#22899
TheNeuralBit merged 4 commits into
apache:masterfrom
TheNeuralBit:nested-row

Conversation

@TheNeuralBit

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

R: @chamikaramj

@github-actions

Copy link
Copy Markdown
Contributor

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

@codecov

codecovBot commented Aug 25, 2022

Copy link
Copy Markdown

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 
FlagCoverage Δ
python83.51% <100.00%> (-0.01%)⬇️

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

Impacted FilesCoverage Δ
sdks/python/apache_beam/typehints/row_type.py100.00% <100.00%> (+2.98%)⬆️
sdks/python/apache_beam/typehints/__init__.py77.77% <0.00%> (-22.23%)⬇️
...thon/apache_beam/ml/inference/pytorch_inference.py0.00% <0.00%> (ø)
...apache_beam/typehints/pandas_type_compatibility.py94.95% <0.00%> (ø)
sdks/python/apache_beam/runners/common.py88.71% <0.00%> (+0.12%)⬆️
sdks/python/apache_beam/transforms/util.py96.22% <0.00%> (+0.15%)⬆️
sdks/python/apache_beam/dataframe/schemas.py97.88% <0.00%> (+0.20%)⬆️
...eam/runners/interactive/interactive_environment.py92.02% <0.00%> (+0.30%)⬆️
...eam/runners/portability/fn_api_runner/execution.py93.08% <0.00%> (+0.64%)⬆️
sdks/python/apache_beam/utils/interactive_utils.py97.56% <0.00%> (+2.43%)⬆️
... and 3 more

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

@chamikaramjchamikaramj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks.

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

Run Python PreCommit

@chamikaramjchamikaramj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks.

Copy link
Copy Markdown
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
Copy Markdown
Contributor

@TheNeuralBit Can this be merged ?

@TheNeuralBit

Copy link
Copy Markdown
MemberAuthor

@TheNeuralBit Can this be merged ?

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

@TheNeuralBit

Copy link
Copy Markdown
MemberAuthor

Run Python PreCommit

1 similar comment
@TheNeuralBit

Copy link
Copy Markdown
MemberAuthor

Run Python PreCommit

@TheNeuralBit
TheNeuralBit merged commit b8ca081 into apache:masterSep 1, 2022
@TheNeuralBitTheNeuralBit mentioned this pull request Sep 1, 2022
4 tasks
Sign up for freeto 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

@TheNeuralBit@chamikaramj