Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions google/cloud/aiplatform/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@
reservation_affinity_v1 as gca_reservation_affinity_v1,
)

_FEATURE_PATH_PATTERN = re.compile(
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/featureGroups/(?P<feature_group>.+?)/features/(?P<feature>.+?)$"
)

VertexAiServiceClient = TypeVar(
"VertexAiServiceClient",
# v1beta1
Expand Down Expand Up @@ -730,10 +734,7 @@ def feature_path(
@staticmethod
def parse_feature_path(path: str) -> Dict[str, str]:
"""Parses a feature path into its component segments."""
m = re.match(
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/featureGroups/(?P<feature_group>.+?)/features/(?P<feature>.+?)$",
path,
)
m = _FEATURE_PATH_PATTERN.match(path)
return m.groupdict() if m else {}

class FeatureRegistryServiceClientV1(
Expand Down