Skip to content

feat: auto coerce dataframes#44

Open
manzt wants to merge 1 commit intomainfrom
manzt/df
Open

feat: auto coerce dataframes#44
manzt wants to merge 1 commit intomainfrom
manzt/df

Conversation

@manzt
Copy link
Copy Markdown
Contributor

@manzt manzt commented Sep 21, 2023

Right now you need to create an Embeddings from a dataframe to use the EmbeddingComparisonWidget. This PR lets you pass in dataframes as well, and will select the x, y, label, robust (option) columns to create the Embedding object.

Comment on lines +61 to +62
left_embedding: Embedding | pd.DataFrame,
right_embedding: Embedding | pd.DataFrame,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this backwards compatible with Python versions before 11?

Copy link
Copy Markdown
Contributor Author

@manzt manzt Sep 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the top of the file uses:

from __future__ import annotations

Which tells Python to treat everything after the : in types as comments. We only use for static type checking, so this allows us to use modern syntax. If we needed to inspect the types at runtime (e.g., using pydantic in this file), we'd want to avoid using __future__ annotations imports and find a typing syntax that is backward compatbile.

@manzt manzt force-pushed the main branch 5 times, most recently from 2406222 to acad765 Compare October 17, 2024 06:04
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.

2 participants