python-bigquery-dataframes icon indicating copy to clipboard operation
python-bigquery-dataframes copied to clipboard

refactor: reorganize `remote_function` code for readability

Open shobsi opened this issue 1 year ago • 1 comments

Currently the user facing functions remote_function and read_gbq_function have entry points through the Session class and bigframes.pandas module. Most of the underlying code currently exists in bigframes.functions.remote_function which has grown large. This module is not promoted to be used by the end user directly, and is not included in the public documentation. This refactoring involves following changes to the code in this module:

  1. Move RemoteFunctionClient to a separate module remote_function_client
  2. Rename _RemoteFunctionSession class to RemoteFunctionSession and move to a separate module remote_function_session
  3. Moved a bunch of module level functions to utils module

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> 🦕

shobsi avatar Aug 06 '24 05:08 shobsi

Hard to fully review, but LGTM assuming this is a pure refactoring.

Added some explanation in the description. Technically this refactoring could break someone using those internal purpose classes and methods directly. If that's a concern I can leave aliases in the previous module, but didn't so far to avoid unnecessary clutter.

shobsi avatar Aug 12 '24 16:08 shobsi