Skip to content

Conversation

@jgray-19
Copy link
Collaborator

@jgray-19 jgray-19 commented Jun 5, 2025

Closes #22

@jgray-19 jgray-19 requested a review from Copilot June 5, 2025 12:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds an option to force the use of pandas when converting to a DataFrame, ensuring that the conversion works as expected when tfs-pandas is not installed.

  • Updated tests in tests/test_object_wrapping.py to pass a new force_pandas flag and use the pandas alias (pd).
  • Modified the to_df and convert_to_dataframe methods in src/pymadng/madp_classes.py to include and propagate the force_pandas parameter.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/test_object_wrapping.py Updated test functions to support and verify the new force_pandas parameter behavior.
src/pymadng/madp_classes.py Added force_pandas parameter to DataFrame conversion functions and updated docstrings.
Comments suppressed due to low confidence (2)

tests/test_object_wrapping.py:372

  • [nitpick] Consider renaming the 'DataFrame' parameter to something like 'df_class' to better indicate that it represents a DataFrame type.
def generalDataFrame(self, headers, DataFrame, force_pandas=False):

src/pymadng/madp_classes.py:232

  • Add a brief comment explaining why 'force_pandas' is set to True upon catching an ImportError, to clarify that pandas is used when tfs-pandas is unavailable.
force_pandas = True

@jgray-19 jgray-19 merged commit 22cc5e7 into main Jun 5, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add way to get a vanilla pandas data frame instead of tfspandas

2 participants