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

remove image top level import by default #31

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/datachain/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
from datachain.lib.feature import Feature
from datachain.lib.feature_utils import pydantic_to_feature
from datachain.lib.file import File, FileError, FileFeature, IndexedFile, TarVFile
from datachain.lib.image import ImageFile, convert_images
from datachain.lib.text import convert_text
from datachain.lib.udf import Aggregator, Generator, Mapper
from datachain.lib.utils import AbstractUDF, DataChainError
from datachain.query.dataset import UDF as BaseUDF # noqa: N811
Expand All @@ -23,12 +21,9 @@
"FileError",
"FileFeature",
"Generator",
"ImageFile",
"IndexedFile",
"Mapper",
"Session",
"TarVFile",
"convert_images",
"convert_text",
"pydantic_to_feature",
]
3 changes: 3 additions & 0 deletions src/datachain/image/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from datachain.lib.image import ImageFile, convert_images

__all__ = ["ImageFile", "convert_images"]
3 changes: 3 additions & 0 deletions src/datachain/text/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from datachain.lib.text import convert_text

__all__ = ["convert_text"]
5 changes: 2 additions & 3 deletions tests/unit/test_module_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ def test_module_exports():
FileError,
FileFeature,
Generator,
ImageFile,
IndexedFile,
Mapper,
Session,
TarVFile,
convert_images,
convert_text,
pydantic_to_feature,
)
from datachain.image import ImageFile, convert_images
from datachain.text import convert_text
except Exception as e: # noqa: BLE001
pytest.fail(f"Importing raised an exception: {e}")
Loading