Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
olejandro committed Mar 24, 2024
1 parent 7c79262 commit 2479691
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions xl2times/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,15 @@ def apply_composite_tag(table: datatypes.EmbeddedXlTable) -> datatypes.EmbeddedX
df = table.dataframe
# Check for ANSWER-style defaults
if "=" in defaults:
# Split multiple comma-separated defaults
if "," in defaults:
defaults = defaults.split(",")
else:
# Make it a list
defaults = list([defaults])
# Split multiple comma-separated defaults / make defaults a list
defaults = defaults.split(",")
# Check whether there are invalid values on the list
invalid_defaults = [default for default in defaults if "=" not in default]
if invalid_defaults:
logger.warning(
f"Expected ANSWER-style defaults, got {invalid_defaults}"
)
defaults = [default.split("=") for default in defaults]
defaults = [default.split("=") for default in defaults if "=" in default]
# TODO: check whether a column is allowed in a particular table type
for col, val in defaults:
colname = col.lower()
Expand Down

0 comments on commit 2479691

Please sign in to comment.