Skip to content

Commit

Permalink
fixed the union type bug for events
Browse files Browse the repository at this point in the history
  • Loading branch information
yifanwu committed Apr 15, 2022
1 parent 1470a7f commit 375c76c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion lineapy/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from lineapy.transformer.node_transformer import transform
from lineapy.utils.analytics import send_lib_info_from_db
from lineapy.utils.benchmarks import distribution_change
from lineapy.utils.constants import VERSION_PLACEHOLDER
from lineapy.utils.logging_config import (
LOGGING_ENV_VARIABLE,
configure_logging,
Expand Down
7 changes: 3 additions & 4 deletions lineapy/graph_reader/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
GetVersionEvent,
track,
)
from lineapy.utils.constants import VERSION_PLACEHOLDER

logger = logging.getLogger(__name__)

Expand All @@ -46,6 +45,8 @@ class LineaArtifact:
"""session id of the session that created the artifact"""
name: str
"""name of the artifact"""
_version: str
"""version of the artifact - This is set when the artifact is saved. The format of the version currently is specified by the constant :const:`lineapy.utils.constants.VERSION_DATE_STRING`"""
date_created: Optional[datetime] = field(default=None, repr=False)
# setting repr to false for date_created for now since it duplicates version
"""Optional because date_created cannot be set by the user.
Expand All @@ -54,9 +55,7 @@ class LineaArtifact:
the first time, it will be unset. When you get the artifact or
catalog of artifacts, we retrieve the date from db and
it will be set."""
_version: str
"""version of the artifact - This is set when the artifact is saved. The format of the version currently is specified by the constant :const:`lineapy.utils.constants.VERSION_DATE_STRING`"""


@property
def version(self) -> str:
track(GetVersionEvent(""))
Expand Down
1 change: 0 additions & 1 deletion lineapy/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@

# linea internal defaults
VERSION_DATE_STRING = "%Y-%m-%dT%H:%M:%S"
VERSION_PLACEHOLDER: str = "UNSET"
"""sqlalchemy defaults to a type of Optional[str] even when a column is set to be not nullable.
This is per their documentation. One option is to add type:ignore for python objects that
should not be nulls and are mapped to sqlalchemy ORM objects. Alternately, as is here,
Expand Down

0 comments on commit 375c76c

Please sign in to comment.