-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add support for FLOAT to Python RowCoder #22626
Conversation
@lostluck it looks like Go might be using the same coder for single-precision floats as for double-precision, is that right? From the Go PreCommit:
|
Yes that does seem to be the case: beam/sdks/go/pkg/beam/core/graph/coder/row_encoder.go Lines 211 to 214 in cc0b446
Would you be opposed to me sending a change to encode as single-precision in that case? |
Codecov Report
@@ Coverage Diff @@
## master #22626 +/- ##
==========================================
- Coverage 74.19% 74.19% -0.01%
==========================================
Files 709 709
Lines 93499 93524 +25
==========================================
+ Hits 69370 69387 +17
- Misses 22852 22860 +8
Partials 1277 1277
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Assigning reviewers. If you would like to opt out of this review, comment R: @AnandInguva for label python. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
Well I tried to modify Go's RowCoder but couldn't manage to get the test working right. Instead I've just skipped this case, and filed #22629 to track. |
Run Java PreCommit |
@AnandInguva do you have time to review this? |
@TheNeuralBit I am on vacation. I will be back on Aug 22nd. |
assign to next reviewer |
R: @tvalentyn |
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control |
Oops Valentyn is also out |
@@ -51,6 +51,7 @@ var unimplementedCoders = map[string]bool{ | |||
var filteredCases = []struct{ filter, reason string }{ | |||
{"logical", "BEAM-9615: Support logical types"}, | |||
{"30ea5a25-dcd8-4cdb-abeb-5332d15ab4b9", "https://github.com/apache/beam/issues/21206: Support encoding position."}, | |||
{"8c97b6c5-69e5-4733-907b-26cd8edae612", "https://github.com/apache/beam/issues/22629: Support single-precision float."}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noting there's a race with #22664. Whichever is merged later should remove this exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jrmccluskey this test case is still failing in Go. It looks like it may just be a test infra issue, but I'm not able to debug on my own. Could you take a look?
I'm re-opening #22629 to track
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you share the output from the test failure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I should have shared it to begin with but it had scrolled out of my shell history and I was lazy 😬
I dropped the log in #22629 (comment)
df729fa
to
bcb3822
Compare
Run Go PreCommit |
@@ -455,6 +455,17 @@ examples: | |||
|
|||
--- | |||
|
|||
coder: | |||
urn: "beam:coder:row:v1" | |||
# f_float: float32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why f_float instead of float or float32?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f_float here is the name of a field in the schema. We could call it "float" or "float32" instead, but it's not that important. I just followed the f_ convention used elsewhere.
@@ -455,6 +455,17 @@ examples: | |||
|
|||
--- | |||
|
|||
coder: | |||
urn: "beam:coder:row:v1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you double check this is not a typo. For example with double this is:
beam:coder:double:v1
I would suspect this should be
beam:coder:float:v1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a reference to row coder:
beam/model/pipeline/src/main/proto/org/apache/beam/model/pipeline/v1/beam_runner_api.proto
Line 1062 in 3173b50
ROW = 13 [(beam_urn) = "beam:coder:row:v1"]; |
Row Coder is a complex coder that is parameterized by a Beam Schema. It encodes different types of values by deferring to other coders, like beam:coder:double:v1
for DOUBLE
* Add support for FLOAT to Python RowCoder * Skip the new test case in Go
Part of #19815
This adds support for encoding the schema type FLOAT to Python's RowCoder. This is added in a new coder,
SinglePrecisionFloatCoder
, designed to be compatible with Java'sFloatCoder
.GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI.