--------------------------------------------------------------------------- KeyError Traceback (most recent call last) Cell In[7], line 2 1 import fabric_cat_tools as fct ----> 2 fct.run_model_bpa(datasetName = 'Daily Sellout', extend = True) File /nfs4/pyenv-8783cfd4-1392-427b-9970-230f8a49f16d/lib/python3.10/site-packages/fabric_cat_tools/ModelBPA.py:539, in run_model_bpa(datasetName, rulesDataFrame, workspaceName, extend) 534 return df_outputs 536 # flatten list of lists 537 flatten_dfs = [ 538 df --> 539 for dfs in rulesDataFrame.apply(execute_rule, axis=1).tolist() 540 for df in dfs] 542 finalDF = pd.concat(flatten_dfs, ignore_index=True) 544 pd.set_option('display.max_colwidth', 100) File ~/cluster-env/trident_env/lib/python3.10/site-packages/pandas/core/frame.py:9423, in DataFrame.apply(self, func, axis, raw, result_type, args, **kwargs) 9412 from pandas.core.apply import frame_apply 9414 op = frame_apply( 9415 self, 9416 func=func, (...) 9421 kwargs=kwargs, 9422 ) -> 9423 return op.apply().__finalize__(self, method="apply") File ~/cluster-env/trident_env/lib/python3.10/site-packages/pandas/core/apply.py:678, in FrameApply.apply(self) 675 elif self.raw: 676 return self.apply_raw() --> 678 return self.apply_standard() File ~/cluster-env/trident_env/lib/python3.10/site-packages/pandas/core/apply.py:798, in FrameApply.apply_standard(self) 797 def apply_standard(self): --> 798 results, res_index = self.apply_series_generator() 800 # wrap results 801 return self.wrap_results(results, res_index) File ~/cluster-env/trident_env/lib/python3.10/site-packages/pandas/core/apply.py:814, in FrameApply.apply_series_generator(self) 811 with option_context("mode.chained_assignment", None): 812 for i, v in enumerate(series_gen): 813 # ignore SettingWithCopy here in case the user mutates --> 814 results[i] = self.f(v) 815 if isinstance(results[i], ABCSeries): 816 # If we have a view on v, we need to make a copy because 817 # series_generator will swap out the underlying data 818 results[i] = results[i].copy(deep=False) File /nfs4/pyenv-8783cfd4-1392-427b-9970-230f8a49f16d/lib/python3.10/site-packages/fabric_cat_tools/ModelBPA.py:521, in run_model_bpa..execute_rule(row) 518 violation_func = violation_cols_or_func 520 # build output data frame --> 521 df_output = violation_func(df_violations).copy() 523 df_output.columns = ['Object Name'] 524 df_output['Rule Name'] = row['Rule Name'] File /nfs4/pyenv-8783cfd4-1392-427b-9970-230f8a49f16d/lib/python3.10/site-packages/fabric_cat_tools/ModelBPA.py:516, in run_model_bpa..execute_rule..(violations) 514 # subset the right output columns (e.g. Table Name & Column Name) 515 if isinstance(violation_cols_or_func, list): --> 516 violation_func = lambda violations: violations[violation_cols_or_func] 517 else: 518 violation_func = violation_cols_or_func File ~/cluster-env/trident_env/lib/python3.10/site-packages/pandas/core/frame.py:3767, in DataFrame.__getitem__(self, key) 3765 if is_iterator(key): 3766 key = list(key) -> 3767 indexer = self.columns._get_indexer_strict(key, "columns")[1] 3769 # take() does not accept boolean indexers 3770 if getattr(indexer, "dtype", None) == bool: File ~/cluster-env/trident_env/lib/python3.10/site-packages/pandas/core/indexes/base.py:5877, in Index._get_indexer_strict(self, key, axis_name) 5874 else: 5875 keyarr, indexer, new_indexer = self._reindex_non_unique(keyarr) -> 5877 self._raise_if_missing(keyarr, indexer, axis_name) 5879 keyarr = self.take(indexer) 5880 if isinstance(key, Index): 5881 # GH 42790 - Preserve name from an Index File ~/cluster-env/trident_env/lib/python3.10/site-packages/pandas/core/indexes/base.py:5938, in Index._raise_if_missing(self, key, indexer, axis_name) 5936 if use_interval_msg: 5937 key = list(key) -> 5938 raise KeyError(f"None of [{key}] are in the [{axis_name}]") 5940 not_found = list(ensure_index(key)[missing_mask.nonzero()[0]].unique()) 5941 raise KeyError(f"{not_found} not in index") KeyError: "None of [Index(['Hierarchy Name'], dtype='object')] are in the [columns]"