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

Unused Parameters in to_flat_dicts Function #484

Open
pajusmar opened this issue Sep 11, 2024 · 0 comments
Open

Unused Parameters in to_flat_dicts Function #484

pajusmar opened this issue Sep 11, 2024 · 0 comments

Comments

@pajusmar
Copy link

Bug Report

Description:
The to_flat_dicts function in the delta.py file has parameters include_action_in_path and report_type_changes that are defined but not used in the function call to self.to_flat_rows. This results in the parameters being ineffective.

Steps to Reproduce:

  1. Define a Delta object.
  2. Call the to_flat_dicts method with custom values for include_action_in_path and report_type_changes.
  3. Observe that the custom values are not passed to the self.to_flat_rows method.

Expected Behavior:
The include_action_in_path and report_type_changes parameters should be passed to the self.to_flat_rows method within the to_flat_dicts function.

Actual Behavior:
The parameters include_action_in_path and report_type_changes are not passed to the self.to_flat_rows method, making them ineffective.

Code:

def to_flat_dicts(self, include_action_in_path=False, report_type_changes=True) -> List[FlatDeltaRow]:
    return [
        i._asdict() for i in self.to_flat_rows(include_action_in_path=False, report_type_changes=True)
    ]

Suggested Fix:

Pass the include_action_in_path and report_type_changes parameters to the self.to_flat_rows method.

def to_flat_dicts(self, include_action_in_path=False, report_type_changes=True) -> List[FlatDeltaRow]:
    return [
        i._asdict() for i in self.to_flat_rows(include_action_in_path=include_action_in_path, report_type_changes=report_type_changes)
    ]

Environment:

  • Python 3.10
  • DeepDiff 8.0.1
  • Windows
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

No branches or pull requests

1 participant