Skip to content

Commit

Permalink
Merge pull request #29 from kthyng/tweak
Browse files Browse the repository at this point in the history
relaxed condition to pass through existing keys
  • Loading branch information
kthyng authored Sep 22, 2023
2 parents 13b52a2 + fc1ed40 commit a836b52
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cf_pandas/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ def __getitem__(self, key: str) -> Union[pd.Series, pd.DataFrame]:

# if key is a coordinate or axes, use a different method to match
valid_keys = _COORD_NAMES + _AXIS_NAMES
if key in valid_keys:
# return the key if it is already a name in the object and doesn't need to be interpreted
if key in self._obj.keys():
col_names = [key]

elif key in valid_keys:
col_names = _get_axis_coord(self._obj, key)

else:
Expand Down

0 comments on commit a836b52

Please sign in to comment.