-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ingest): fix metadata for custom python packages (#9391)
- Loading branch information
Showing
5 changed files
with
60 additions
and
29 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
Empty file.
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,36 @@ | ||
from typing import ClassVar | ||
|
||
from avrogen.dict_wrapper import DictWrapper | ||
|
||
|
||
class _Aspect(DictWrapper): | ||
"""Base class for all aspects types. | ||
All codegened types inherit from DictWrapper, either directly or indirectly. | ||
Types that are aspects inherit directly from _Aspect. | ||
""" | ||
|
||
ASPECT_NAME: ClassVar[str] = None # type: ignore | ||
ASPECT_TYPE: ClassVar[str] = "default" | ||
ASPECT_INFO: ClassVar[dict] = None # type: ignore | ||
|
||
def __init__(self): | ||
if type(self) is _Aspect: | ||
# Ensure that it cannot be instantiated directly, as | ||
# per https://stackoverflow.com/a/7989101/5004662. | ||
raise TypeError( | ||
"_Aspect is an abstract class, and cannot be instantiated directly." | ||
) | ||
super().__init__() | ||
|
||
@classmethod | ||
def get_aspect_name(cls) -> str: | ||
return cls.ASPECT_NAME # type: ignore | ||
|
||
@classmethod | ||
def get_aspect_type(cls) -> str: | ||
return cls.ASPECT_TYPE | ||
|
||
@classmethod | ||
def get_aspect_info(cls) -> dict: | ||
return cls.ASPECT_INFO |