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

chore: unimplemented API tracking #1269

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

chore: unimplemented API tracking #1269

wants to merge 8 commits into from

Conversation

Genesis929
Copy link
Collaborator

@Genesis929 Genesis929 commented Jan 7, 2025

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)

Currently this covers Series class and DataFrame class
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-dataframes API. labels Jan 7, 2025
self.method_name,
args,
kwargs,
task=PANDAS_API_TRACKING_TASK,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm a bit confused by this. Why the extra task argument?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Task is to identify why the labels are collected. The PANDAS_API_TRACKING_TASK means the method is missing(like df.resample). The PANDAS_PARAM_TRACKING_TASK means args or kwargs are missing, but the method has already being implemented. Later in dashboard this may help.

)


def submit_pandas_labels(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add a docstring explaining the purpose of this method.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated

@@ -30,6 +37,78 @@
_call_stack: List = []


class UnimplementedMethodLogger:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Pease add a docstring.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated

return method(*args, **kwargs)
return method(self, *args, **kwargs)
except (NotImplementedError, TypeError) as e:
if hasattr(self, "_block") and len(_call_stack) == 1:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add a comment explaining why we have these requirements in the if statement.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated

'pandas.DataFrame.{key}'. {constants.FEEDBACK_LINK}
"""
)
return log_adapter.UnimplementedMethodLogger(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm confused. Why would we ever return this class to the user?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Return this is because gettattr won't get the args and kwargs. By returning the class, the class will be called as a function and receive the args and kwargs, and then we can set the labels.

'pandas.Series.{key}'. {constants.FEEDBACK_LINK}
"""
)
return log_adapter.UnimplementedMethodLogger(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Likewise, returning here seems wrong.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Return this is because gettattr won't get the args and kwargs. By returning the class, the class will be called as a function and receive the args and kwargs, and then we can set the labels.

@Genesis929 Genesis929 added the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 10, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 10, 2025
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-dataframes API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants