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

objectdb: add __rich_repr__ #267

Merged
merged 1 commit into from
Dec 30, 2023
Merged

objectdb: add __rich_repr__ #267

merged 1 commit into from
Dec 30, 2023

Conversation

skshetry
Copy link
Member

This will format repr nicely if you use rich for printing (as I do in pdb and ipython).

This may be not useful for repr(db), but if you, for example have a very verbose output, this becomes very useful.

Eg:

StorageMapping(
    {
        (): StorageInfo(
            data=None,
            cache=ObjectStorage(
                key=(),
                odb=HashFileDB(
                    fs=<dvc_objects.fs.local.LocalFileSystem object at 0x1109e68d0>,
                    path='/private/var/folders/xh/trg29z296h70n109kwfk6g800000gn/T/pytest-of-saugat/pytest-278/pytest-servers13',
                    read_only=False
                ),
                index=None,
                read_only=False
            ),
            remote=None
        )
    }
)
StorageMapping({(): StorageInfo(data=None, cache=ObjectStorage(key=(), odb=HashFileDB(fs=<dvc_objects.fs.local.LocalFileSystem object at 0x1109e68d0>, path='/private/var/folders/xh/trg29z296h70n109kwfk6g800000gn/T/pytest-of-saugat/pytest-278/pytest-servers13', read_only=False), index=None, read_only=False), remote=None)})

@skshetry skshetry merged commit add14dd into main Dec 30, 2023
2 checks passed
@skshetry skshetry deleted the add-rich-repr branch December 30, 2023 08:09
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.

1 participant