Re: [sqlalchemy] Copy a dataframe to postgresql database within a schema

2022-02-23 Thread Nahum Castro
Yes, you were right. thanks. El mié, 23 feb 2022 a la(s) 13:34, Mike Bayer (mike...@zzzcomputing.com) escribió: > the "from msilib import schema" import is at the top of your script. it > looks like it's there by accident. are you using vscode? I find it often > adds random package names as

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

2022-02-23 Thread janio mendonca junior
Hi Simon, Thank you for your help. I am brand new working with SQLalchemy, really appreciate if you explain how to generate the metadata with the list of column names from the .CSV to create the tables? On Wed, Feb 23, 2022, 3:52 PM Simon King wrote: > Build a list of Column objects from the

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

2022-02-23 Thread Simon King
Build a list of Column objects from the columns in the CSV file, and use that list to create a Table: https://docs.sqlalchemy.org/en/14/core/metadata.html Once you've created the Table, you can insert data into it using the table.insert() method:

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

2022-02-23 Thread janio mendonca junior
Hi all, I have a inquiry from my job to create 2 tables related one-to-one and insert some rows on the table. I have a .CSV with the data dictionary from the table and I am wondering to know how to declare the tables columns automatically without write one by one column (there are 260 columns).

Re: [sqlalchemy] Copy a dataframe to postgresql database within a schema

2022-02-23 Thread Mike Bayer
the "from msilib import schema" import is at the top of your script. it looks like it's there by accident. are you using vscode? I find it often adds random package names as it guesses from my typing. I'd remove that line. On Wed, Feb 23, 2022, at 1:54 PM, Nahum Castro wrote: > Hello All. >

[sqlalchemy] Copy a dataframe to postgresql database within a schema

2022-02-23 Thread Nahum Castro
Hello All. I have a problem when I try to load a dataframe to postgresql and store it in a schema.. from msilib import schema import pandas as pd import numpy as np import glob from sqlalchemy import create_engine from datetime import datetime, timedelta engine =

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

2022-02-23 Thread shuhari2020
*FROM*: https://stackoverflow.com/questions/71225408/issue-translating-raw-sql-to-sqlalchemy-orm-query I have the following raw SQL statement that I am having trouble "translating" into a SQLAlchemy query: (the hardcoded value 38 is just for testing) *SELECT * FROM public.data_appquestion AS