Skip to content

fix(select_values_template): fix pandas/numpy version compatibility i…#392

Merged
fangliu117 merged 1 commit intodevfrom
template_select_values
Aug 4, 2025
Merged

fix(select_values_template): fix pandas/numpy version compatibility i…#392
fangliu117 merged 1 commit intodevfrom
template_select_values

Conversation

@fangliu117
Copy link
Collaborator

…ssue

Copilot AI review requested due to automatic review settings August 4, 2025 12:26
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 fixes pandas/numpy version compatibility issues in the select_values_template by improving warning handling to distinguish between deprecation warnings and operational warnings.

Key changes:

  • Enhanced warning filtering to skip deprecation warnings from numpy/pandas
  • Improved warning message handling with proper string conversion
  • Added explicit warning capture configuration

)
if caught_warnings is not None:
# Only process warnings that are relevant to the select_values operation
if caught_warnings:
Copy link

Copilot AI Aug 4, 2025

Choose a reason for hiding this comment

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

The condition if caught_warnings: is redundant since caught_warnings is always a list when using warnings.catch_warnings(record=True). Consider removing this check or making it more explicit like if len(caught_warnings) > 0:.

Suggested change
if caught_warnings:
if len(caught_warnings) > 0:

Copilot uses AI. Check for mistakes.
Comment on lines +95 to +96
if hasattr(warning, 'message'):
raise ValueError(str(warning.message))
Copy link

Copilot AI Aug 4, 2025

Choose a reason for hiding this comment

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

The hasattr(warning, 'message') check is unnecessary and potentially problematic. Warning objects always have a message attribute. This check could mask actual warnings if the attribute check fails unexpectedly.

Suggested change
if hasattr(warning, 'message'):
raise ValueError(str(warning.message))
raise ValueError(str(warning.message))

Copilot uses AI. Check for mistakes.
@fangliu117 fangliu117 merged commit c11f641 into dev Aug 4, 2025
19 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.

2 participants