-
Notifications
You must be signed in to change notification settings - Fork 285
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
chore: circular imports and name input #92
Conversation
return os.path.join(dataset_dir, self.name) | ||
return self.__directory |
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.
Nice.
src/phoenix/datasets/dataset.py
Outdated
from phoenix.datasets import EmbeddingColumnNames, Schema | ||
from phoenix.datasets.schema import EmbeddingColumnNames, Schema |
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.
Do we want to import this way going forward, or is this a temporary fix? We still have from .schema import EmbeddingColumnNames, Schema
in phoenix.datasets.__init__.py
.
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.
This is where I personally think it's fine to be importing from ".schema" here - they are part of the same directory / module.
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.
Do we want to remove from .schema import EmbeddingColumnNames, Schema
from phoenix.datasets.__init__.py
in that case?
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 think letting the DX be from phoenix.datasets import Schema, Dataset
feels like the best ergonomics.
Does this not work?
classDiagram
__init__ <|-- Dataset
Dataset <|-- Schema
__init__ <|-- Schema
class Dataset{
+Schema schema
}
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 will change so that files in the same directory use local imports. Keeping the DX such that they can import useful entities in one line as it is now from phoenix.datasets import Schema, Dataset
No description provided.