Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyongzhu committed Jun 13, 2022
1 parent f059f00 commit ebd4f69
Showing 1 changed file with 32 additions and 29 deletions.
61 changes: 32 additions & 29 deletions feathr_project/feathr/registry/_feature_registry_purview.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,18 +778,18 @@ def list_registered_features(self, project_name: str, limit=100, starting_offset
# see syntax here: https://docs.microsoft.com/en-us/rest/api/purview/catalogdataplane/discovery/query#discovery_query_andornested
query_filter = {
"and": [
{
"or":
[
{"entityType": TYPEDEF_DERIVED_FEATURE},
{"entityType": TYPEDEF_ANCHOR_FEATURE}
]
},
{
"attributeName": "qualifiedName",
"operator": "startswith",
"attributeValue": project_name + self.registry_delimiter
}
{
"or":
[
{"entityType": TYPEDEF_DERIVED_FEATURE},
{"entityType": TYPEDEF_ANCHOR_FEATURE}
]
},
{
"attributeName": "qualifiedName",
"operator": "startswith",
"attributeValue": project_name + self.registry_delimiter
}
]
}
result = self.purview_client.discovery.query(filter=query_filter)
Expand Down Expand Up @@ -890,23 +890,26 @@ def _list_registered_entities_with_details(self, project_name: str, entity_type:
query_filter = {
"or":
[{
"and": [ {
"or": [{"entityType": e} for e in entity_type_list] # this is a list of the entity types that you want to query
},
{
"attributeName": "qualifiedName",
"operator": "startswith",
"attributeValue": project_name + self.registry_delimiter
}] },
{
"and": [ {
"or": [{"entityType": TYPEDEF_FEATHR_PROJECT}] if TYPEDEF_FEATHR_PROJECT in entity_type_list else None # this is a list of the entity types that you want to query
},
{
"attributeName": "qualifiedName",
"operator": "startswith",
"attributeValue": project_name
} ]} ]
"and": [{
# this is a list of the entity types that you want to query
"or": [{"entityType": e} for e in entity_type_list]
},
{
"attributeName": "qualifiedName",
"operator": "startswith",
# use `project_name + self.registry_delimiter` to limit the search results
"attributeValue": project_name + self.registry_delimiter
}]},
# if we are querying TYPEDEF_FEATHR_PROJECT, then "union" the result by using this query
{
"and": [{
"or": [{"entityType": TYPEDEF_FEATHR_PROJECT}] if TYPEDEF_FEATHR_PROJECT in entity_type_list else None
},
{
"attributeName": "qualifiedName",
"operator": "startswith",
"attributeValue": project_name
}]}]
}

# Important properties returned includes:
Expand Down

0 comments on commit ebd4f69

Please sign in to comment.