-
Notifications
You must be signed in to change notification settings - Fork 99
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
fix(datasets): remove deprecation warnings #255
Conversation
ed371a1
to
f4ffbd2
Compare
This comment was marked as resolved.
This comment was marked as resolved.
c08df50
to
cc1ee79
Compare
e560c3c
to
0803bb4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 Should this be added to the release notes for future reference?
Thanks @merelcht ! Will add some release notes. I'm struggling to understand why the tensorflow tests present some numerical failures and why our linting got triggered in some files I didn't touch 😕 do you think we can bring some help? |
Do they fail locally as well? |
I confirm the tensorflow tests don't fail on Gitpod. The linting failures are there though, mostly |
I'm not quite sure why it suddenly flags that, but I would just ignore it. The amount of public methods hasn't changed. I wonder if it's some strange thing where it can't figure out this is inheriting from |
b923752
to
82b174b
Compare
Signed-off-by: Juan Luis Cano Rodríguez <[email protected]>
Signed-off-by: Juan Luis Cano Rodríguez <[email protected]>
Signed-off-by: Juan Luis Cano Rodríguez <[email protected]>
Signed-off-by: Juan Luis Cano Rodríguez <[email protected]>
Co-authored-by: Deepyaman Datta <[email protected]> Signed-off-by: Juan Luis Cano Rodríguez <[email protected]>
Signed-off-by: Juan Luis Cano Rodríguez <[email protected]>
Signed-off-by: Juan Luis Cano Rodríguez <[email protected]>
Identified the pylint message as a possible bug: pylint-dev/pylint#8865 Proceeding to selectively ignore it. |
See pylint-dev/pylint#8865 Signed-off-by: Juan Luis Cano Rodríguez <[email protected]>
82b174b
to
3f0b644
Compare
Signed-off-by: Juan Luis Cano Rodríguez <[email protected]>
51bb35a
to
5168a47
Compare
Linting sorted out, TensorFlow tests still acting up. |
Couldn't reproduce the failures in a dedicated branch: https://github.com/kedro-org/kedro-plugins/actions/runs/5608121558/jobs/10260084023?pr=275 So it's either flakiness, or something introduced by this PR. |
Restarted the job, exact same result. I'm discarding flakiness, so I suppose there's something introduced by this PR that creates the problem. |
Signed-off-by: Deepyaman Datta <[email protected]>
This needs to be addressed later on, see TODO. Signed-off-by: Juan Luis Cano Rodríguez <[email protected]>
This made the TF tests failures go away: diff --git a/kedro-datasets/kedro_datasets/tensorflow/tensorflow_model_dataset.py b/kedro-datasets/kedro_datasets/tensorflow/tensorflow_model_dataset.py
index ad9e844f..e13c2cb5 100644
--- a/kedro-datasets/kedro_datasets/tensorflow/tensorflow_model_dataset.py
+++ b/kedro-datasets/kedro_datasets/tensorflow/tensorflow_model_dataset.py
@@ -8,10 +8,17 @@
import fsspec
import tensorflow as tf
-from kedro.io.core import Version, get_filepath_str, get_protocol_and_path
-from .._io import AbstractVersionedDataset as AbstractVersionedDataSet
-from .._io import DatasetError as DataSetError
+# TODO: Replace these imports by the appropriate ones from kedro_datasets._io
+# to avoid deprecation warnings for users,
+# see https://github.com/kedro-org/kedro-plugins/pull/255
+from kedro.io.core import (
+ AbstractVersionedDataSet,
+ DataSetError,
+ Version,
+ get_filepath_str,
+ get_protocol_and_path,
+)
TEMPORARY_H5_FILE = "tmp_tensorflow_model.h5" I'm 100 % sure there's something fishy with pytest fixtures or mocks, and not the dataset itself. However, investigating this can take some time that at the moment we don't have. The result of this commit, for now, is that importing the tensorflow dataset will give a deprecationwarning the user cannot act upon (because they don't have control over the class hierarchy). re-requesting approval from @merelcht before merging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for digging so deep into the tensorflow issue. I think this is a good solution and don't think it hurts the user experience too much 👍
* Unpin pytest-xdist to avoid deprecation error Signed-off-by: Juan Luis Cano Rodríguez <[email protected]> * Remove deprecation warnings from kedro-datasets Signed-off-by: Juan Luis Cano Rodríguez <[email protected]> * Adapt future deprecation of Abstract*DataSet Signed-off-by: Juan Luis Cano Rodríguez <[email protected]> * Add tests for backwards and forwards compatibility Signed-off-by: Juan Luis Cano Rodríguez <[email protected]> * Typo Co-authored-by: Deepyaman Datta <[email protected]> Signed-off-by: Juan Luis Cano Rodríguez <[email protected]> * Make _io tests restore old values Signed-off-by: Juan Luis Cano Rodríguez <[email protected]> * Lint Signed-off-by: Juan Luis Cano Rodríguez <[email protected]> * Ignore faulty pylint check See pylint-dev/pylint#8865 Signed-off-by: Juan Luis Cano Rodríguez <[email protected]> * Disable a few more faulty pylint checks Signed-off-by: Juan Luis Cano Rodríguez <[email protected]> * Remove shim from tensorflow datasets This needs to be addressed later on, see TODO. Signed-off-by: Juan Luis Cano Rodríguez <[email protected]> --------- Signed-off-by: Juan Luis Cano Rodríguez <[email protected]> Signed-off-by: Deepyaman Datta <[email protected]> Co-authored-by: Deepyaman Datta <[email protected]>
Description
Close #264.
After the next Kedro release, importing certain
kedro.io.core
classes will emitDeprecationWarning
s. However, we don't want this to happen in code the user can't control.This introduces a
kedro_datasets._io
private shim that helps importing the right class in a backwards and forwards compatible way. As a result,DeprecationWarning
s do not appear.Before:
After:
(I mean... that's a mouthful too, but kedro-org/kedro#2744)
Development notes
Alternatively, we could use the
try ... except ImportError ...
in all datasets. But this makes the diff smaller, plus gives us a way to includeAbstractDataset
andAbstractVersionedDataset
in the future if we decide to rename those too.Checklist
RELEASE.md
file