-
Notifications
You must be signed in to change notification settings - Fork 3
feat: use centralized constants #227
base: main
Are you sure you want to change the base?
Conversation
71d3283
to
53c50ca
Compare
d3507cb
to
c38dbe1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should use Enums instead.
Something like this as an example for table_property:
from enum import Enum
class TABLE_PROPERTY_NAME(Enum):
PATH = "path"
NAME = "name"
def table_property(
self, table_id: str, property_name: TABLE_PROPERTY_NAME, default_value: str = None
):
property_value = self.get_all_details().get(
f"{table_id}_{property_name.value}", default_value
)
table_property(property_name=TABLE_PROPERTY_NAME.PATH)
Good point. I will try using StrEnum. |
Since the atc-dataplatform use configuration variables as name, partitioning, format, etc. These string values are used very often. In order to ensure that it is always the same string values that are used across the atc we could introduce them as constants.
Following PEP8 Constants:
https://peps.python.org/pep-0008/#constants