Skip to content

Commit

Permalink
Mypy workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
shape-warrior-t committed Dec 8, 2023
1 parent e0a1e63 commit be5b473
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/astra/data/database/db_initializer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""This module initializes the database and provides the schema for the tables."""
from datetime import datetime
from typing import Any

from sqlalchemy import (
create_engine,
ForeignKey,
Expand All @@ -25,7 +27,9 @@ def set_sqlite_pragma(dbapi_connection, connection_record):


# A declarative base class that helps mapping to the relational schema
Base = declarative_base()
# Mypy complains about using Base as a base class for some reason,
# so annotate with Any as a workaround

This comment has been minimized.

Copy link
@johnnyjly

johnnyjly Dec 8, 2023

Contributor

"type of Base is not yet inferred during semantic analysis"
See: python/mypy#2477 (comment)

Base: Any = declarative_base()


def initialize_sqlite_db():
Expand Down

0 comments on commit be5b473

Please sign in to comment.