|
3 | 3 | from datetime import datetime
|
4 | 4 | from typing import List
|
5 | 5 |
|
6 |
| -from metabase.resource import ListResource, CreateResource, GetResource, UpdateResource, DeleteResource |
7 |
| -from missing import MISSING |
| 6 | +from metabase.resource import ListResource, CreateResource, GetResource, UpdateResource |
| 7 | +from metabase.missing import MISSING |
8 | 8 |
|
9 | 9 |
|
10 | 10 | class Metric(ListResource, CreateResource, GetResource, UpdateResource):
|
@@ -64,21 +64,18 @@ def update(
|
64 | 64 | show_in_getting_started: bool = MISSING,
|
65 | 65 | **kwargs
|
66 | 66 | ) -> None:
|
67 |
| - params = { |
68 |
| - "revision_message": revision_message, |
69 |
| - "name": name, |
70 |
| - "description": description, |
71 |
| - "definition": definition, |
72 |
| - "how_is_this_calculated": how_is_this_calculated, |
73 |
| - "points_of_interest": points_of_interest, |
74 |
| - "caveats": caveats, |
75 |
| - "archived": archived, |
76 |
| - "show_in_getting_started": show_in_getting_started, |
| 67 | + return super(Metric, self).update( |
| 68 | + revision_message=revision_message, |
| 69 | + name=name, |
| 70 | + description=description, |
| 71 | + definition=definition, |
| 72 | + how_is_this_calculated=how_is_this_calculated, |
| 73 | + points_of_interest=points_of_interest, |
| 74 | + caveats=caveats, |
| 75 | + archived=archived, |
| 76 | + show_in_getting_started=show_in_getting_started, |
77 | 77 | **kwargs
|
78 |
| - } |
79 |
| - params = {k: v for k, v in params.items() if v != MISSING} |
80 |
| - |
81 |
| - return super(Metric, self).update(**params) |
| 78 | + ) |
82 | 79 |
|
83 | 80 | def archive(self):
|
84 | 81 | return self.update(archived=True, revision_message="Archived by metabase-python.")
|
0 commit comments