Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Pretty printing dataset #3987
Pretty printing dataset #3987
Changes from 23 commits
502f982
9aa704f
45b51e8
94e6465
e2884e7
248a2c0
aea8ec0
659de36
d1cb03f
4de32c4
9e6bae9
57f9a3f
e61a775
0f84735
3a7e748
216cb42
ca42da1
924b53e
f529c4b
7754078
14f237f
cfac9d6
bfc0841
7190b3c
54964f8
1b0ae7a
c6a8a31
22aec50
28a961d
d5cd26b
d7f50aa
52945dd
2073d74
001e7f7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
If it comes from
kedro_datasets
, I feel like it would be much cleaner to have the short name users can provide (i.e.pandas.CSVDataset
instead ofkedro_datasets.pandas.csv_dataset.CSVDataset
).Similarly, from Kedro core,
MemoryDataset
, etc. seems much easier to read than the full path.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.
I agree on your points but decided to keep the full path, so
__repr__
is as less ambiguous as possible and one could easily understand where to look the implementation of the printed dataset.Ideally, it would be good to have some
"short=True"
flag for the representation that can be set by user. But by default, I prefer to keep a full module name.Curious what other think.
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.
Happy to hear what others think, but IMO we actually don't use the module name in the docs and examples. The standard way people write entries in catalog is the "short" version, and I think that should be reflected.
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.
We can also consider adding
__str__
with a short representation, so that__repr__
is actual representation but__str__
adapted for printingThere 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.
Most users we've spoken to create their own datasets sooner or later, so people have a mix between short and long names in the catalog.
Also, the long name would work even for
kedro-datasets
right? The fact that we use the short one is a matter of convention and convenience. But arguably it obscures where the datasets come from, and maybe play a role in people not understanding their tracebacks (especially withs
vsS
).So I'm slightly in favour of keeping the long names for all datasets to avoid introducing an exception to the logic written here, but I don't have a strong opinion.
(In either case, no matter what we do I don't think we should complicate the implementation with a flag.)