-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests for share package #10
Conversation
@@ -66,10 +70,17 @@ def kwargs(self) -> dict[str, Any]: | |||
|
|||
@kwargs.setter | |||
def kwargs(self, value: dict[str, Any]) -> None: | |||
init_kwargs: list[str] = [key for key in value if key in self._kwargs] |
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.
validate value
has all the required keys
for x in value.keys(): | ||
if x in self._kwargs: | ||
self.__setattr__(x, value[x]) | ||
if self.__getattribute__(x) is None: | ||
if not self.__getattribute__(x): |
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.
we want to check emptiness, not None
@@ -219,30 +230,31 @@ def add_input(self, new_input: Input) -> None: | |||
|
|||
def parse_config(config_yaml: str) -> Config: | |||
yaml_config = yaml.safe_load(config_yaml) | |||
assert isinstance(yaml_config, dict) |
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.
assert proper type from config_yaml
|
||
conf: Config = Config() | ||
|
||
if "inputs" not in yaml_config or not isinstance(yaml_config["inputs"], list): | ||
raise ValueError("No inputs provided") | ||
|
||
for input_config in yaml_config["inputs"]: | ||
if "type" not in input_config: | ||
raise ValueError("Must be provided type for input") | ||
if "type" not in input_config or not isinstance(input_config["type"], str): |
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.
check type as well
|
||
if "id" not in input_config: | ||
raise ValueError("Must be provided id for input") | ||
if "id" not in input_config or not isinstance(input_config["id"], str): |
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.
check type as well
|
||
current_input: Input = Input(input_type=input_config["type"], input_id=input_config["id"]) | ||
|
||
if "outputs" not in input_config or not isinstance(input_config["outputs"], list): | ||
raise ValueError("No valid outputs for input") | ||
|
||
for output_config in input_config["outputs"]: | ||
if "type" not in output_config: | ||
raise ValueError("Must be provided type for output") | ||
if "type" not in output_config or not isinstance(output_config["type"], str): |
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.
check type as well
|
||
if "args" not in output_config: | ||
raise ValueError("Must be provided args for output") | ||
if "args" not in output_config or not isinstance(output_config["args"], dict): |
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.
check type as well
@@ -50,7 +50,7 @@ def create(output: str, **kwargs: Any) -> CommonShipper: | |||
output_builder: Callable[..., CommonShipper] = output_definition["class"] | |||
|
|||
init_kwargs: list[str] = [key for key in kwargs.keys() if key in output_kwargs and kwargs[key]] | |||
if len(init_kwargs) is not len(output_kwargs): | |||
if len(init_kwargs) != len(output_kwargs): |
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.
proper check
@@ -28,7 +28,7 @@ def create(storage_type: str, **kwargs: Any) -> CommonStorage: | |||
storage_builder: Callable[..., CommonStorage] = storage_definition["class"] | |||
|
|||
init_kwargs: list[str] = [key for key in kwargs.keys() if key in storage_kwargs and kwargs[key]] | |||
if len(init_kwargs) is not len(storage_kwargs): | |||
if len(init_kwargs) != len(storage_kwargs): |
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.
proper check
@@ -1,4 +1,4 @@ | |||
git+git://github.com/basepi/apm-agent-python.git@lambda | |||
elastic-apm>=6.6.0,<6.7 |
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.
lambda support is now released
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
No description provided.