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

feat: add Model.transform_columns property #1661

Merged
merged 19 commits into from Oct 12, 2023
Merged

Conversation

SalemJorden
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery API. labels Sep 18, 2023
@SalemJorden SalemJorden changed the title added TransformColumns class + corresponding unit tests feat: add Model.transform_columns property Sep 20, 2023
@@ -184,6 +184,20 @@ def feature_columns(self) -> Sequence[standard_sql.StandardSqlField]:
standard_sql.StandardSqlField.from_api_repr(column) for column in resource
]

@property
def transform_columns(self) -> Sequence[Dict[str, Any]]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make this return a sequence of your new TransformColumn objects instead of a sequence of dictionaries.

google/cloud/bigquery/model.py Outdated Show resolved Hide resolved
google/cloud/bigquery/model.py Outdated Show resolved Hide resolved
google/cloud/bigquery/model.py Outdated Show resolved Hide resolved
google/cloud/bigquery/model.py Outdated Show resolved Hide resolved
google/cloud/bigquery/model.py Outdated Show resolved Hide resolved
tests/unit/model/test_model.py Outdated Show resolved Hide resolved
tests/unit/model/test_model.py Outdated Show resolved Hide resolved
tests/unit/model/test_model.py Outdated Show resolved Hide resolved
tests/unit/model/test_model.py Outdated Show resolved Hide resolved
@tswast tswast added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 22, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 22, 2023
google/cloud/bigquery/model.py Outdated Show resolved Hide resolved
google/cloud/bigquery/model.py Outdated Show resolved Hide resolved
tests/unit/model/test_model.py Outdated Show resolved Hide resolved
.coverage.salemb-macbookpro.roam.internal.75772.634632 Outdated Show resolved Hide resolved
Copy link
Contributor

@tswast tswast left a comment

Choose a reason for hiding this comment

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

TransformColumn is looking quite good now. A few more comments to address, please.

google/cloud/bigquery/model.py Outdated Show resolved Hide resolved
tests/unit/model/test_model.py Outdated Show resolved Hide resolved
tests/unit/model/test_model.py Outdated Show resolved Hide resolved
@tswast tswast marked this pull request as ready for review October 11, 2023 20:36
@tswast tswast requested review from a team as code owners October 11, 2023 20:36
"name": "transform_name" ,
"type": {"typeKind": "INT64"},
"transformSql": "transform_sql"
}]
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's run "nox -r -s blacken" from the terminal to format this.

@tswast tswast enabled auto-merge (squash) October 11, 2023 20:55
google/cloud/bigquery/model.py Outdated Show resolved Hide resolved
tests/unit/model/test_model.py Outdated Show resolved Hide resolved
@tswast tswast added automerge Merge the pull request once unit tests and other checks pass. and removed automerge Merge the pull request once unit tests and other checks pass. labels Oct 12, 2023
@tswast tswast merged commit 5ceed05 into googleapis:main Oct 12, 2023
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants