question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello,

The latest version of the stubs makes mypy log an error on insert(SAModel).from_select(...):

Argument 1 to "Insert" has incompatible type "Type[SAModel]"; expected "Union[str, Selectable]"

while this is something that works with SQLAlchemy.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
rjaduthiecommented, May 19, 2021

I’ve come across a related problem, but with update.

I have a database model create like:

from sqlalchemy.ext.automap import automap_base
ModelBase: Any = automap_base()

class MyTable(ModelBase):
"""A table"""
id = Column(Integer, primary_key=True)
name = Column(String)

Then attempting to create an SQL statement:

from sqlalchemy import update
statement = update(MyTable).where(id == some_value).value(**some_values)

The result from mypy is:

Argument 1 to "Update" has incompatible type "Type[MyTable]"; expected "Union[str, Selectable]"

SQLAlchemy == 1.4.15 sqlalchemy-stubs == 0.4 mypy == 0.800 mypy-extensions == 0.4.3

0reactions
marquesdscommented, Aug 30, 2022

I’m also running in the same error 😞

Read more comments on GitHub >

github_iconTop Results From Across the Web

Eloquent: Getting Started - Laravel - The PHP Framework For ...
Inserting & Updating Models ... the database table, Eloquent models allow you to insert, update, and delete records from the table as well....
Read more >
Mongoose v6.8.1: Models
Models are responsible for creating and reading documents from the underlying MongoDB database. Compiling your first model; Constructing Documents; Querying ...
Read more >
Insert 3D models - Sketchfab
Insert 3D models ready to view, buy, and download for free. Popular Insert 3D models. View all.
Read more >
Create Rows - Use the Session - INSERT - SQLModel
Create a Model Instance¶. Let's start with the first step, create the data in memory. We already created a class Hero that represents...
Read more >
insert - Recent models | 3D CAD Model Collection - GrabCAD
The GrabCAD Library offers millions of free CAD designs, CAD files, and 3D models. Join the GrabCAD Community today to gain access and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found