-
Notifications
You must be signed in to change notification settings - Fork 27
Variable is null #1627
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
Variable is null #1627
Changes from all commits
a23ab00
868988e
c19cc23
abf60a6
61c0420
203053b
562d242
8d2cc0b
48e97ce
2652643
917795f
8bac70f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,19 +3,16 @@ | |
|
|
||
| class VariableIsNull(BaseOperation): | ||
| def _execute_operation(self): | ||
| # Always get the content dataframe. Similar to variable_exists check | ||
| dataframe = self.data_service.get_dataset(dataset_name=self.params.dataset_path) | ||
| if self.params.target.startswith("define_variable"): | ||
| # Handle checks against define metadata | ||
| target_column = self.evaluation_dataset[self.params.target] | ||
| result = [ | ||
| self._is_target_variable_null(dataframe, value) | ||
| for value in target_column | ||
| ] | ||
| return self.data_service.dataset_implementation().convert_to_series(result) | ||
| if self.params.source == "submission": | ||
| if self.params.level == "row": | ||
| raise ValueError("level: row may only be used with source: evaluation") | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we please add a unit test covering this case ensuring ValueError is raised? We can cover other combinations too that can happen in real case.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is done |
||
| dataframe = self.data_service.get_dataset( | ||
| dataset_name=self.params.dataset_path | ||
| ) | ||
| else: | ||
| target_variable = self.params.target | ||
| return self._is_target_variable_null(dataframe, target_variable) | ||
| dataframe = self.evaluation_dataset | ||
|
|
||
| return self._is_target_variable_null(dataframe, self.params.target) | ||
|
|
||
| def _is_target_variable_null(self, dataframe, target_variable: str) -> bool: | ||
| if target_variable not in dataframe: | ||
|
|
||
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.
The new changes does not have this check of starting with define_variable. Is this case handled by evaluation dataset branch now? Could you please explain briefly?
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.
if a define is contained, it will be a define rule type and those variable will be accessible via the evaluation dataset built by that define rule type.