Galileo-Galilei / kedro-pandera

A kedro plugin to use pandera in your kedro projects
https://kedro-pandera.readthedocs.io/en/latest/
Apache License 2.0
33 stars 4 forks source link

:bug: Fix AttributeError in datasets with missing metadata parameter (#67) #68

Closed michal-mmm closed 2 months ago

michal-mmm commented 2 months ago

Description

Why was this PR created? Fix #67

Development notes

What have you changed, and how has this been tested?

Checklist

Notice

Galileo-Galilei commented 2 months ago

Hi, thank you very much for the PR. Can you please:

I'll release as soon as you push.

michal-mmm commented 2 months ago

Hi, I've made the changes. But now one test locally is failing: FAILED tests/framework/hooks/test_hook.py::test_validate_only_once - assert 2 == 1 It's due to a previous PR (#66)

michal-mmm commented 2 months ago

What do you think about adding this fragment? Remove logging info? Or make it a separate PR?

for name, data in datasets.items(): # not changed
   if name in self._validated_datasets:
      self._logger.info(f"(kedro-pandera) Dataset '{name}' has been already validated with pandera")
      continue
   metadata = getattr(catalog._datasets[name], "metadata", None) # not changed
Galileo-Galilei commented 2 months ago

It's due to the removal of line 61 in the if condition: and name not in self._validated_datasets, you should put it back

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (dc12425) to head (8cdb17c).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #68 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 5 5 Lines 112 113 +1 ========================================= + Hits 112 113 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

michal-mmm commented 2 months ago

you're right, I'm blind :-) I've added the missing condition