Skip to content

[BEAM-10677] Fix @SchemaFieldName in AutoValueSchema - #12520

Merged
TheNeuralBit merged 2 commits into
apache:masterfrom
TheNeuralBit:autovalueschema-schemafieldname
Sep 30, 2020
Merged

[BEAM-10677] Fix @SchemaFieldName in AutoValueSchema#12520
TheNeuralBit merged 2 commits into
apache:masterfrom
TheNeuralBit:autovalueschema-schemafieldname

Conversation

@TheNeuralBit

Copy link
Copy Markdown
Member

Post-Commit Tests Status (on master branch)

LangSDKDataflowFlinkSamzaSparkTwister2
GoBuild Status---Build Status---Build Status---
JavaBuild StatusBuild Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build StatusBuild Status
Build Status
Build Status
Build Status
PythonBuild Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
---Build Status---
XLangBuild Status---Build Status---Build Status---

Pre-Commit Tests Status (on master branch)

---JavaPythonGoWebsite
Non-portableBuild StatusBuild Status
Build Status
Build Status
Build StatusBuild Status
Portable---Build Status------

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

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels

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

// Verify that constructor parameters match (name and type) the inferred schema.
for (Parameter parameter : constructor.getParameters()) {
FieldValueTypeInformation type = typeMap.getOrDefault(parameter.getName(), null);
if (type == null || type.getRawType() != parameter.getType()) {

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 quite sure what the old logic was trying to verify. Now this verifies that every constructor parameter corresponds to a schema field.

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 believe the getterTypes is the list of schema name, where typeMap is the attribute name from AutoValue class. It's trying to verify whether the schema matches the AutoValue class since it wants to get a constructor.

@TheNeuralBit

Copy link
Copy Markdown
MemberAuthor

Run Python 3.8 PostCommit

@TheNeuralBitTheNeuralBit changed the title [BEAM-10633] Fix @SchemaFieldName in AutoValueSchema[BEAM-10663] Fix @SchemaFieldName in AutoValueSchemaAug 11, 2020
@TheNeuralBitTheNeuralBit changed the title [BEAM-10663] Fix @SchemaFieldName in AutoValueSchema[BEAM-10677] Fix @SchemaFieldName in AutoValueSchemaAug 11, 2020
@TheNeuralBit

Copy link
Copy Markdown
MemberAuthor

retest this please

@TheNeuralBit

Copy link
Copy Markdown
MemberAuthor

Run Python 3.8 PostCommit

@TheNeuralBit

Copy link
Copy Markdown
MemberAuthor

R: @kennknowles do you have time to take a look at this?

@kennknowles
kennknowles self-requested a review September 10, 2020 23:13
@TheNeuralBit
TheNeuralBit merged commit db4e126 into apache:masterSep 30, 2020
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.

3 participants

@TheNeuralBit@kennknowles@boyuanzz