Skip to content

Commit

Permalink
Fix TypeError: 'type' object is not subscriptable
Browse files Browse the repository at this point in the history
Syntax of list[], tuple[] are only supported since python3.9. This change makes this code runnable for python3.8
  • Loading branch information
mondwan authored Oct 21, 2024
1 parent 478e859 commit 205ca3e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions atlas_provider_sqlalchemy/ddl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import importlib.util
import inspect
from pathlib import Path
from typing import Any, Protocol
from typing import Any, Protocol, Tuple, List

import sqlalchemy as sa

Expand All @@ -21,7 +21,7 @@ class ModelsNotFoundError(Exception):
pass


def sqlalchemy_version() -> tuple[int, ...]:
def sqlalchemy_version() -> Tuple[int, ...]:
"""Get major and minor version of sqlalchemy."""

return tuple(int(x) for x in sa.__version__.split("."))
Expand Down Expand Up @@ -86,7 +86,7 @@ def dump(sql, *multiparams, **params):
return metadata


def print_ddl(dialect_driver: str, models: list[DBTableDesc]) -> None:
def print_ddl(dialect_driver: str, models: List[DBTableDesc]) -> None:
"""Dump DDL statements for the metadata from the given models/tables to stdout."""

dump_ddl(dialect_driver=dialect_driver, metadata=models[0].metadata)

0 comments on commit 205ca3e

Please sign in to comment.