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

refactor: Rename MatplotlibWriter to MatplotlibDataset #1027

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

SajidAlamQB
Copy link
Contributor

@SajidAlamQB SajidAlamQB commented Mar 4, 2025

Description

Related to: #353

This PR implements the of renaming MatplotlibWriter to MatplotlibDataset for consistency with other datasets in the codebase.

In the current release:

  • Both classes are available
  • MatplotlibWriter now inherits from MatplotlibDataset and raises deprecation warnings

In a future major release:

  • MatplotlibWriter will be completely removed only MatplotlibDataset will remain

Development notes

  • Created a new MatplotlibDataset class which is identical to MatplotlibWriter except for the name.
  • Refactored MatplotlibWriter to inherit from MatplotlibDataset while adding deprecation warnings.
  • Updated the __init__.py.
  • Updated documentation to include both classes, with clear deprecation notices for MatplotlibWriter.
  • Updated test files to test both classes.

Checklist

  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Updated jsonschema/kedro-catalog-X.XX.json if necessary
  • Added a description of this change in the relevant RELEASE.md file
  • Added tests to cover my changes
  • Received approvals from at least half of the TSC (required for adding a new, non-experimental dataset)

Signed-off-by: Sajid Alam <sajid_alam@mckinsey.com>
Signed-off-by: Sajid Alam <sajid_alam@mckinsey.com>
@SajidAlamQB SajidAlamQB self-assigned this Mar 4, 2025
@SajidAlamQB SajidAlamQB changed the title Rename MatplotlibWriter to MatplotlibDataset Refactor: Rename MatplotlibWriter to MatplotlibDataset Mar 4, 2025
Signed-off-by: Sajid Alam <sajid_alam@mckinsey.com>
@SajidAlamQB SajidAlamQB changed the title Refactor: Rename MatplotlibWriter to MatplotlibDataset refactor: Rename MatplotlibWriter to MatplotlibDataset Mar 4, 2025
@SajidAlamQB SajidAlamQB linked an issue Mar 4, 2025 that may be closed by this pull request
SajidAlamQB and others added 10 commits March 6, 2025 12:15
Signed-off-by: Sajid Alam <sajid_alam@mckinsey.com>
Signed-off-by: Sajid Alam <sajid_alam@mckinsey.com>
Signed-off-by: Sajid Alam <sajid_alam@mckinsey.com>
Signed-off-by: Sajid Alam <sajid_alam@mckinsey.com>
Signed-off-by: Sajid Alam <sajid_alam@mckinsey.com>
Signed-off-by: Sajid Alam <sajid_alam@mckinsey.com>
…ro-org/kedro-plugins into feat/rename-matplotlibwriter

Signed-off-by: Sajid Alam <sajid_alam@mckinsey.com>
Signed-off-by: Sajid Alam <sajid_alam@mckinsey.com>
@SajidAlamQB SajidAlamQB marked this pull request as ready for review March 11, 2025 13:45
"version": self._version,
}

def load(self) -> NoReturn:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is not documented well in the older docs as well. It says Loads data by delegation to the provided load method.. In code we raise an error

save_args:
format: png

Example usage for the
Copy link
Contributor

Choose a reason for hiding this comment

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

image

[Nit] The example usage still uses plot_writer variable names when assigning MatplotlibDataset instances. May be plot_dataset would be better

"The MatplotlibWriter class has been renamed to MatplotlibDataset. "
"The MatplotlibWriter name is deprecated and will be removed in a future release.",
DeprecationWarning,
stacklevel=2,
Copy link
Contributor

@ravi-kumar-pilla ravi-kumar-pilla Mar 11, 2025

Choose a reason for hiding this comment

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

I tested initializing this class with the example usage provided in the docs. For some reason I am not seeing this deprecation warning. Any snippet to QA the warning ?

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.

kedro-datasets: Rename MatplotlibWriter to MatplotlibDataset
2 participants