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

docs: update load_connector() docstring #604

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pandasai/smart_dataframe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ def load_connector(self, temporary: bool = False):
Load a connector into the smart dataframe

Args:
connector (BaseConnector): Connector to be loaded
temporary (bool): Whether the connector is for one time usage.
If `True` passed, the connector will be unbound during
the next call of `dataframe` providing that dataframe has
been loaded.
"""
Comment on lines 155 to 162
Copy link
Contributor

Choose a reason for hiding this comment

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

The new parameter temporary is mentioned in the docstring but it's not included in the function signature. This could lead to confusion and potential errors when using this method. Please ensure that the function signature matches the documentation.

- def load_connector(self):
+ def load_connector(self, temporary=False):

self.dataframe = self.connector.execute()
self._df_loaded = True
Comment on lines 163 to 164
Copy link
Contributor

Choose a reason for hiding this comment

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

The logic of unbinding the connector if temporary is set to True is missing. If the intention is to unbind the connector after its execution when temporary is True, you should add a condition to check the value of temporary and act accordingly.

  self.dataframe = self.connector.execute()
  self._df_loaded = True
+ if temporary:
+     self.connector = None

Expand Down