Skip to content

Commit ded5c29

Browse files
abrookinsclaude
andcommitted
Fix Python 3.9 compatibility in CLI type annotations
Replace Python 3.10+ union syntax (str | None) with Optional[str] to ensure compatibility with Python 3.9 used in CI 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent d8dbc8b commit ded5c29

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

aredis_om/model/cli/migrate.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import asyncio
22
import os
3+
from typing import Optional
34

45
import click
56

@@ -24,7 +25,7 @@ def migrate():
2425

2526
@migrate.command()
2627
@click.option("--migrations-dir", help="Directory containing schema migration files")
27-
def status(migrations_dir: str | None):
28+
def status(migrations_dir: Optional[str]):
2829
"""Show current schema migration status from files."""
2930

3031
async def _status():
@@ -66,10 +67,10 @@ async def _status():
6667
help="Skip confirmation prompt to create directory or run",
6768
)
6869
def run(
69-
migrations_dir: str | None,
70+
migrations_dir: Optional[str],
7071
dry_run: bool,
7172
verbose: bool,
72-
limit: int | None,
73+
limit: Optional[int],
7374
yes: bool,
7475
):
7576
"""Run pending schema migrations from files."""
@@ -119,7 +120,7 @@ async def _run():
119120
@click.option(
120121
"--yes", "-y", is_flag=True, help="Skip confirmation prompt to create directory"
121122
)
122-
def create(name: str, migrations_dir: str | None, yes: bool):
123+
def create(name: str, migrations_dir: Optional[str], yes: bool):
123124
"""Create a new schema migration snapshot file from current pending operations."""
124125

125126
async def _create():
@@ -161,7 +162,7 @@ async def _create():
161162
)
162163
def rollback(
163164
migration_id: str,
164-
migrations_dir: str | None,
165+
migrations_dir: Optional[str],
165166
dry_run: bool,
166167
verbose: bool,
167168
yes: bool,

aredis_om/model/cli/migrate_data.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"""
77

88
import asyncio
9+
from typing import Optional
910

1011
import click
1112

@@ -175,7 +176,7 @@ async def _run():
175176
@click.option(
176177
"--yes", "-y", is_flag=True, help="Skip confirmation prompt to create directory"
177178
)
178-
def create(name: str, migrations_dir: str | None, yes: bool):
179+
def create(name: str, migrations_dir: Optional[str], yes: bool):
179180
"""Create a new migration file."""
180181

181182
async def _create():

0 commit comments

Comments
 (0)