-
Notifications
You must be signed in to change notification settings - Fork 299
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
Lazy load modules #1590
Merged
Merged
Lazy load modules #1590
Changes from 27 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
a565367
lazy load module
pingsutw 704d04d
lazy load module
pingsutw 4dc8ade
import
pingsutw d4d9f52
nit
pingsutw 4fde300
nit
pingsutw 1d02277
nit
pingsutw ffaa8d7
keep structured dataset in flytekit init
pingsutw fbcb2f2
nit
pingsutw 5d055ca
nit
pingsutw 6529118
fixed tess
pingsutw acd819b
merged master
pingsutw 44668e6
nit
pingsutw 31349d8
Merge branch 'master' of github.com:flyteorg/flytekit into lazy_import
pingsutw 3977964
fixed tests
pingsutw 6944658
merged master
pingsutw 6694dfa
fixed tests
pingsutw 53b0c52
nit
pingsutw feb3bed
move import pandas to __init__
pingsutw f34b1be
use lazy import loader instead
pingsutw 2fa180e
Fixed tests
pingsutw c46ef4b
Fixed tests
pingsutw 2a0ef85
wip
pingsutw be79371
fix tests
pingsutw eb7d523
regular import
pingsutw 90730be
fixed tests
pingsutw 318079c
merged master
pingsutw 82eafc4
test
pingsutw 56dc5d8
lint
pingsutw 33f8a3c
merged master
pingsutw 25076fa
nit
pingsutw 00a7c03
lint
pingsutw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, field | ||
from typing import Dict, Optional | ||
|
||
from kubernetes.client.models import V1PodSpec | ||
from dataclasses import dataclass | ||
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(init=True, repr=True, eq=True, frozen=True) | ||
@dataclass(init=True, repr=True, eq=True, frozen=False) | ||
class PodTemplate(object): | ||
"""Custom PodTemplate specification for a Task.""" | ||
|
||
pod_spec: V1PodSpec = field(default_factory=lambda: V1PodSpec(containers=[])) | ||
pod_spec: "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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
needs optional now
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.
done