Re: [sqlalchemy] What is the best way to declare a table with 260 columns and add rows on that table

2022-02-25 Thread janio mendonca junior
Hi Simon, Thank you for your explanation. I managed to create the table by using df.to_sql. My mistake was because I was using a serie to sql instead of a dataframe. On Fri, Feb 25, 2022 at 5:33 AM Simon King wrote: > I don't know enough about Pandas to explain your error, but I did >

Re: [sqlalchemy] Issue "translating" raw SQL to SQLAlchemy ORM query

2022-02-25 Thread Simon King
By default, relationship loading is deliberately not affected by your join conditions. If you want a relationship property to be restricted to the rows you've selected in your query, you need to use the "contains_eager()" query option:

Re: [sqlalchemy] What is the best way to declare a table with 260 columns and add rows on that table

2022-02-25 Thread Simon King
I don't know enough about Pandas to explain your error, but I did notice that the SQL that is failing is trying to insert into a table called "mlstreb", but elsewhere in your code you refer to "mls_treb". Could that be part of the problem? To define a table from your CSV file, you could do