Skip to content

Commit 9b8d6a4

Browse files
authored
scratch: make type of default max_age a float (MaterializeInc#10515)
Previously, bin/scratch create would crash with the following: TypeError: '<=' not supported between instances of 'datetime.timedelta' and 'int' This commit changes the default to a float and by so doing avoids the error.
1 parent 9e6cd77 commit 9b8d6a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

misc/python/materialize/cli/scratch/create.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
whoami,
2727
)
2828

29-
MAX_AGE = datetime.timedelta(days=1.5)
29+
MAX_AGE_DAYS = 1.5
3030

3131

3232
def multi_json(s: str) -> List[Dict[Any, Any]]:
@@ -81,7 +81,7 @@ def configure_parser(parser: argparse.ArgumentParser) -> None:
8181
"Hint: `dev-box` is a good starter!"
8282
),
8383
)
84-
parser.add_argument("--max-age-days", type=float, default=MAX_AGE)
84+
parser.add_argument("--max-age-days", type=float, default=MAX_AGE_DAYS)
8585

8686

8787
def run(args: argparse.Namespace) -> None:

0 commit comments

Comments
 (0)