-
Notifications
You must be signed in to change notification settings - Fork 63
feat: support pandas series in ai.generate_bool #2086
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
|
|
||
| if item.dtype == dtypes.OBJ_REF_DTYPE: | ||
| # Multi-model support | ||
| item = item.blob.read_url() |
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 the pd.Series be converted into a series.Series represented for multi-model? I would suggest to have two IF branches: one for pd.Series and another one for. series.Series, for more readable.
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.
series conversions happens at the bottom of the function body at line 157
This if branch is just to grab the session from the first BigFrames session
| def _convert_series( | ||
| s: series.Series | pd.Series, session: session.Session | None | ||
| ) -> series.Series: | ||
| result = convert.to_bf_series(s, default_index=None, session=session) |
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.
when two series.Series have two different sessions, should we throw an error here?
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 would like to leave that check to the place where we "align" series:
python-bigquery-dataframes/bigframes/operations/base.py
Lines 210 to 212 in 090ce8e
| values, block = self._align_n( | |
| others, ignore_self=ignore_self, cast_scalars=False | |
| ) |
b/443853093