bach.DataFrame.get_all_variable_usage
get_all_variable_usage
()Get all variables that influence the values of this DataFrame.
This includes both variables that are used in the current self.series
, but also variables that
were used in earlier steps, i.e. in the SqlModels of self.base_node
.
The output of this method can be useful for diagnosing issues with variables. If a variable is used multiple times, then it will appear here multiple times. If a variable has conflicting definitions then the conflicting dtypes and/or values are all returned.
Returned data
This method returns a list of DefinedVariable tuples, the fields in the tuples:
- name: name of the variable
- dtype: dtype
- value: value that is currently set in
self.variables
, or None if there is no value - ref_path: If the variable is used in an already materialized part of the DataFrame, i.e. the usage is in self.base_node, then this is the reference path from self.base_node to the SqlModel in which the variable usage occurs. If the variable is used in self.series instead, then this is None
- old_value: If the variable is used in an already materialized part of the DataFrame, then it also has a value already. That is this value. Will be None if this variable usage is not in self.base_node.
Returns
List with all usages of variables in this DataFrame.
Return type
List[bach.dataframe.DefinedVariable]