Skip to content
This repository was archived by the owner on Jun 24, 2024. It is now read-only.

fix: Using generic types when checking _is_column_json and _is_column… #12

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mongosql/bag.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from sqlalchemy import inspect, TypeDecorator
from sqlalchemy import Column
from sqlalchemy.dialects import postgresql as pg
from sqlalchemy.sql import sqltypes as st
from sqlalchemy.ext.associationproxy import AssociationProxy
from sqlalchemy.ext.hybrid import hybrid_property

Expand Down Expand Up @@ -809,12 +809,12 @@ def _get_column_type(col: MapperProperty) -> TypeEngine:

def _is_column_array(col: MapperProperty) -> bool:
""" Is the column a PostgreSql ARRAY column? """
return isinstance(_get_column_type(col), pg.ARRAY)
return isinstance(_get_column_type(col), st.ARRAY)


def _is_column_json(col: MapperProperty) -> bool:
""" Is the column a PostgreSql JSON column? """
return isinstance(_get_column_type(col), (pg.JSON, pg.JSONB))
return isinstance(_get_column_type(col), st.JSON)


def _is_relationship_array(rel: RelationshipProperty) -> bool:
Expand Down