-
Notifications
You must be signed in to change notification settings - Fork 48
fix: Fix issue with invalid sql generated by ml distance functions #865
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
Conversation
bigframes/ml/core.py
Outdated
self.model_name | ||
) | ||
|
||
def _predict_sql( |
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 change the naming? It isn't only used for "predict".
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.
I'm open to suggestions, previous name was very generic. Seems that the class of methods is tvfs that take a tables and add a new transform/prediction/classifiction result column from values in the input table.
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.
What it does is actually executing an ML TVF function and return output as a dataframe. Maybe _exec_ml_tvf? predict is misleading.
@@ -170,12 +170,11 @@ def ml_distance( | |||
col_x: str, | |||
col_y: str, | |||
type: Literal["EUCLIDEAN", "MANHATTAN", "COSINE"], | |||
source_df: bpd.DataFrame, | |||
source_sql: str, |
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.
Is it needed to make this change?
If possible I would rather to let SQL generations stay in sql.py.
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.
Generally, want to invert the dependency between domain objects and sql. Will need to further factor things into a common sql generation module anyways (ml and core bigframes have separate sql modules)
962d7e5
to
3e9af02
Compare
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:
Fixes #<issue_number_goes_here> 🦕