-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* lazy load module Signed-off-by: Kevin Su <pingsutw@apache.org> * lazy load module Signed-off-by: Kevin Su <pingsutw@apache.org> * import Signed-off-by: Kevin Su <pingsutw@apache.org> * nit Signed-off-by: Kevin Su <pingsutw@apache.org> * nit Signed-off-by: Kevin Su <pingsutw@apache.org> * nit Signed-off-by: Kevin Su <pingsutw@apache.org> * keep structured dataset in flytekit init Signed-off-by: Kevin Su <pingsutw@apache.org> * nit Signed-off-by: Kevin Su <pingsutw@apache.org> * nit Signed-off-by: Kevin Su <pingsutw@apache.org> * fixed tess Signed-off-by: Kevin Su <pingsutw@apache.org> * nit Signed-off-by: Kevin Su <pingsutw@apache.org> * fixed tests Signed-off-by: Kevin Su <pingsutw@apache.org> * fixed tests Signed-off-by: Kevin Su <pingsutw@apache.org> * nit Signed-off-by: Kevin Su <pingsutw@apache.org> * move import pandas to __init__ Signed-off-by: Kevin Su <pingsutw@apache.org> * use lazy import loader instead Signed-off-by: Kevin Su <pingsutw@apache.org> * Fixed tests Signed-off-by: Kevin Su <pingsutw@apache.org> * Fixed tests Signed-off-by: Kevin Su <pingsutw@apache.org> * wip Signed-off-by: Kevin Su <pingsutw@apache.org> * fix tests Signed-off-by: Kevin Su <pingsutw@apache.org> * regular import Signed-off-by: Kevin Su <pingsutw@apache.org> * fixed tests Signed-off-by: Kevin Su <pingsutw@apache.org> * test Signed-off-by: Kevin Su <pingsutw@apache.org> * lint Signed-off-by: Kevin Su <pingsutw@apache.org> * nit Signed-off-by: Kevin Su <pingsutw@apache.org> * lint Signed-off-by: Kevin Su <pingsutw@apache.org> --------- Signed-off-by: Kevin Su <pingsutw@apache.org>
- Loading branch information
1 parent
d778232
commit 5a66411
Showing
23 changed files
with
259 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
from dataclasses import dataclass | ||
from typing import Dict, Optional | ||
|
||
from kubernetes.client.models import V1PodSpec | ||
from typing import TYPE_CHECKING, Dict, Optional | ||
|
||
from flytekit.exceptions import user as _user_exceptions | ||
|
||
if TYPE_CHECKING: | ||
from kubernetes.client import V1PodSpec | ||
|
||
PRIMARY_CONTAINER_DEFAULT_NAME = "primary" | ||
|
||
|
||
@dataclass | ||
@dataclass(init=True, repr=True, eq=True, frozen=False) | ||
class PodTemplate(object): | ||
"""Custom PodTemplate specification for a Task.""" | ||
|
||
pod_spec: V1PodSpec = V1PodSpec(containers=[]) | ||
pod_spec: Optional["V1PodSpec"] = None | ||
primary_container_name: str = PRIMARY_CONTAINER_DEFAULT_NAME | ||
labels: Optional[Dict[str, str]] = None | ||
annotations: Optional[Dict[str, str]] = None | ||
|
||
def __post_init__(self): | ||
if self.pod_spec is None: | ||
from kubernetes.client import V1PodSpec | ||
|
||
self.pod_spec = V1PodSpec(containers=[]) | ||
if not self.primary_container_name: | ||
raise _user_exceptions.FlyteValidationException("A primary container name cannot be undefined") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.