Skip to content

Commit

Permalink
Add Dashboard Support #72: More pathing issues
Browse files Browse the repository at this point in the history
Turns out the `.gitignore` ignores the `lib/` dir. This applies to the
`lib` dir within the `actions` dir. Caused me to miss the fact that I
didn't actually commit the `utils.py` file.
  • Loading branch information
jpavlav committed Mar 26, 2024
1 parent f26bfe1 commit fd21727
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion actions/add_gadget.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from lib.base import BaseJiraAction
from utils import remove_empty_attributes
from lib.utils import remove_empty_attributes

__all__ = ["AddGadgetAction"]

Expand Down
2 changes: 1 addition & 1 deletion actions/copy_dashboard.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from lib.base import BaseJiraAction
from utils import remove_empty_attributes
from lib.utils import remove_empty_attributes

__all__ = ["CopyJiraDashboardAction"]

Expand Down
2 changes: 1 addition & 1 deletion actions/create_dashboard.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from lib.base import BaseJiraAction
from utils import remove_empty_attributes
from lib.utils import remove_empty_attributes

__all__ = ["CreateJiraDashboardAction"]

Expand Down
15 changes: 15 additions & 0 deletions actions/lib/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from __future__ import annotations

from typing import Any

__all__ = ["remove_empty_attributes"]


def remove_empty_attributes(data: dict[str, Any]) -> dict[str, Any]:
"""A convenience function to remove key/value pairs with `None` for a value.
Args:
data: A dictionary.
Returns:
Dict[str, Any]: A dictionary with no `None` key/value pairs.
"""
return {key: val for key, val in data.items() if val is not None}
2 changes: 1 addition & 1 deletion actions/update_dashboard.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from lib.base import BaseJiraAction
from utils import remove_empty_attributes
from lib.utils import remove_empty_attributes

__all__ = ["UpdateJiraDashboardAction"]

Expand Down
2 changes: 1 addition & 1 deletion actions/update_gadget.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from lib.base import BaseJiraAction
from utils import remove_empty_attributes
from lib.utils import remove_empty_attributes

__all__ = ["UpdateGadgetAction"]

Expand Down

0 comments on commit fd21727

Please sign in to comment.