Skip to content
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

w.alerts.list(): 'datetime-range' is not a valid ParameterType #20

Closed
grusin-db opened this issue Mar 1, 2023 · 0 comments · Fixed by #22
Closed

w.alerts.list(): 'datetime-range' is not a valid ParameterType #20

grusin-db opened this issue Mar 1, 2023 · 0 comments · Fixed by #22

Comments

@grusin-db
Copy link
Contributor

  1. log into https://e2-demo-field-eng.cloud.databricks.com/?o=1444828305810485
  2. run: w.alerts.list()

I am not sure which alert causes this issue, it would be great if debug=True (or something of this sort) was passable as kwargs to enable debugging of element that caused exception (or is there better way to do it from notebooks?)

Exception:

ValueError                                Traceback (most recent call last)
<command-3538949529976490> in <cell line: 1>()
----> 1 w.alerts.list()

/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/databricks/sdk/service/sql.py in list(self)
   2198 
   2199         json = self._api.do('GET', '/api/2.0/preview/sql/alerts')
-> 2200         return [Alert.from_dict(v) for v in json]
   2201 
   2202     def list_schedules(self, alert_id: str, **kwargs) -> Iterator[RefreshSchedule]:

/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/databricks/sdk/service/sql.py in <listcomp>(.0)
   2198 
   2199         json = self._api.do('GET', '/api/2.0/preview/sql/alerts')
-> 2200         return [Alert.from_dict(v) for v in json]
   2201 
   2202     def list_schedules(self, alert_id: str, **kwargs) -> Iterator[RefreshSchedule]:

/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/databricks/sdk/service/sql.py in from_dict(cls, d)
     70                    name=d.get('name', None),
     71                    options=AlertOptions.from_dict(d['options']) if 'options' in d else None,
---> 72                    query=Query.from_dict(d['query']) if 'query' in d else None,
     73                    rearm=d.get('rearm', None),
     74                    state=AlertState(d['state']) if 'state' in d else None,

/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/databricks/sdk/service/sql.py in from_dict(cls, d)
   1201             latest_query_data_id=d.get('latest_query_data_id', None),
   1202             name=d.get('name', None),
-> 1203             options=QueryOptions.from_dict(d['options']) if 'options' in d else None,
   1204             permission_tier=PermissionLevel(d['permission_tier']) if 'permission_tier' in d else None,
   1205             query=d.get('query', None),

/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/databricks/sdk/service/sql.py in from_dict(cls, d)
   1454     def from_dict(cls, d: Dict[str, any]) -> 'QueryOptions':
   1455         return cls(moved_to_trash_at=d.get('moved_to_trash_at', None),
-> 1456                    parameters=[Parameter.from_dict(v)
   1457                                for v in d['parameters']] if 'parameters' in d else None)
   1458 

/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/databricks/sdk/service/sql.py in <listcomp>(.0)
   1454     def from_dict(cls, d: Dict[str, any]) -> 'QueryOptions':
   1455         return cls(moved_to_trash_at=d.get('moved_to_trash_at', None),
-> 1456                    parameters=[Parameter.from_dict(v)
   1457                                for v in d['parameters']] if 'parameters' in d else None)
   1458 

/local_disk0/.ephemeral_nfs/cluster_libraries/python/lib/python3.9/site-packages/databricks/sdk/service/sql.py in from_dict(cls, d)
   1101         return cls(name=d.get('name', None),
   1102                    title=d.get('title', None),
-> 1103                    type=ParameterType(d['type']) if 'type' in d else None,
   1104                    value=d.get('value', None))
   1105 

/usr/lib/python3.9/enum.py in __call__(cls, value, names, module, qualname, type, start)
    358         """
    359         if names is None:  # simple value lookup
--> 360             return cls.__new__(cls, value)
    361         # otherwise, functional API: we're creating a new Enum type
    362         return cls._create_(

/usr/lib/python3.9/enum.py in __new__(cls, value)
    676                 ve_exc = ValueError("%r is not a valid %s" % (value, cls.__qualname__))
    677                 if result is None and exc is None:
--> 678                     raise ve_exc
    679                 elif exc is None:
    680                     exc = TypeError(

ValueError: 'datetime-range' is not a valid ParameterType
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant