FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
feast/sdk/python/feast/cli/projects.py at master · Gwill/feast · GitHub
Gwill
/
feast
Public
forked from
feast-dev/feast
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
feast
/
sdk
/
python
/
feast
/
cli
/
projects.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
113 lines (98 loc) · 2.74 KB
Breadcrumbs
feast
/
sdk
/
python
/
feast
/
cli
/
projects.py
Copy path
File metadata and controls
113 lines (98 loc) · 2.74 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import
click
import
yaml
from
feast
import
utils
from
feast
.
cli
.
cli_options
import
tagsOption
from
feast
.
errors
import
FeastObjectNotFoundException
,
ProjectNotFoundException
from
feast
.
repo_operations
import
create_feature_store
@
click
.
group
(
name
=
"projects"
)
def
projects_cmd
():
"""
Access projects
"""
pass
@
projects_cmd
.
command
(
"describe"
)
@
click
.
argument
(
"name"
,
type
=
click
.
STRING
)
@
click
.
pass_context
def
project_describe
(
ctx
:
click
.
Context
,
name
:
str
):
"""
Describe a project
"""
store
=
create_feature_store
(
ctx
)
try
:
project
=
store
.
get_project
(
name
)
except
FeastObjectNotFoundException
as
e
:
print
(
e
)
exit
(
1
)
print
(
yaml
.
dump
(
yaml
.
safe_load
(
str
(
project
)),
default_flow_style
=
False
,
sort_keys
=
False
,
)
)
@
projects_cmd
.
command
(
"current_project"
)
@
click
.
pass_context
def
project_current
(
ctx
:
click
.
Context
):
"""
Returns the current project configured with FeatureStore object
"""
store
=
create_feature_store
(
ctx
)
try
:
project
=
store
.
get_project
(
name
=
None
)
except
FeastObjectNotFoundException
as
e
:
print
(
e
)
exit
(
1
)
print
(
yaml
.
dump
(
yaml
.
safe_load
(
str
(
project
)),
default_flow_style
=
False
,
sort_keys
=
False
,
)
)
@
projects_cmd
.
command
(
"delete"
)
@
click
.
argument
(
"name"
,
type
=
click
.
STRING
)
@
click
.
option
(
"-y"
,
"--yes"
,
is_flag
=
True
,
default
=
False
,
help
=
"Skip confirmation prompt and delete immediately."
,
)
@
click
.
pass_context
def
project_delete
(
ctx
:
click
.
Context
,
name
:
str
,
yes
:
bool
):
"""
Delete a project and all its resources from the registry.
"""
store
=
create_feature_store
(
ctx
)
if
not
yes
:
click
.
confirm
(
f"Are you sure you want to delete project '
{
name
}
'? "
"This will remove all associated resources from the registry."
,
abort
=
True
,
)
try
:
store
.
delete_project
(
name
)
except
(
FeastObjectNotFoundException
,
ProjectNotFoundException
)
as
e
:
print
(
str
(
e
))
raise
SystemExit
(
1
)
print
(
f"Project '
{
name
}
' deleted successfully."
)
@
projects_cmd
.
command
(
name
=
"list"
)
@
tagsOption
@
click
.
pass_context
def
project_list
(
ctx
:
click
.
Context
,
tags
:
list
[
str
]):
"""
List all projects
"""
store
=
create_feature_store
(
ctx
)
table
=
[]
tags_filter
=
utils
.
tags_list_to_dict
(
tags
)
for
project
in
store
.
list_projects
(
tags
=
tags_filter
):
table
.
append
([
project
.
name
,
project
.
description
,
project
.
tags
,
project
.
owner
])
from
tabulate
import
tabulate
print
(
tabulate
(
table
,
headers
=
[
"NAME"
,
"DESCRIPTION"
,
"TAGS"
,
"OWNER"
],
tablefmt
=
"plain"
,
)
)
Back
|
FazBrowse Home
|
New Git URL