-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from dlt-hub/rfix/improves-naming
improves naming convention protocol
- Loading branch information
Showing
23 changed files
with
9,674 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,2 @@ | ||
from typing import Callable, Sequence | ||
from .typing import NamingConvention | ||
|
||
# function signature to normalize names | ||
TNormalizeNameFunc = Callable[[str], str] | ||
# function signature to make paths | ||
TNormalizeMakePath = Callable[..., str] | ||
# function signature to break path into components | ||
TNormalizeBreakPath = Callable[[str], Sequence[str]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from typing import Any, Protocol, Sequence | ||
|
||
|
||
class NamingConvention(Protocol): | ||
PATH_SEPARATOR: str | ||
|
||
def normalize_identifier(self, name: str) -> str: | ||
"""Normalizes the identifier according to naming convention represented by this function""" | ||
... | ||
|
||
def normalize_path(self, path: str) -> str: | ||
"""Breaks path into identifiers using PATH_SEPARATOR, normalizes components and reconstitutes the path""" | ||
... | ||
|
||
def normalize_make_path(self, *identifiers: Any) -> str: | ||
"""Builds path out of path identifiers using PATH_SEPARATOR. Identifiers are not normalized""" | ||
... | ||
|
||
def normalize_break_path(self, path: str) -> Sequence[str]: | ||
"""Breaks path into sequence of identifiers""" | ||
... | ||
|
||
def normalize_make_dataset_name(self, dataset_name: str, default_schema_name: str, schema_name: str) -> str: | ||
"""Builds full db dataset (dataset) name out of (normalized) default dataset and schema name""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.