Python Forum
__init__() got multiple values for argument 'schema'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
__init__() got multiple values for argument 'schema'
#1
Hi , which packages do you use when you have issue __init__() got multiple values for argument 'schema'. how can i solve this issue. Which packages will i use? Thanks
Reply
#2
Do you have any code?
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags


Reply
#3
You need to provide more information. __init__() for what class in what package? Posting code would be great so we can see the imports. Also post the error message with the entire error trace.

The only way I can think of to make this happen is to provide a value as a positional argument and as a named argument. Like this:
class Something:
    def __init__(arg1, arg2=0):
        """Has a positional and a named argument"""

x = Something(1, 2, arg2=2)
Error:
x = Something(1, 2, arg2=3) TypeError: Something.__init__() got multiple values for argument 'arg2'
arg2 is passed the value 2 as a positional argument and 3 as a named argument. I would get a similar error doing this:
x = Something(1, arg1=2)
Reply
#4
This is the code

# Import sqlalchemy's create_engine() function
from sqlalchemy import create_engine
import pandas as pd

# Create the database engine
engine = create_engine("oracle+cx_oracle://dw1:dw2@local")


# Create a SQL query to load the entire table
query = """
select*from tab t where trunc(t.date)>'15.12.2023'
"""

# Load with the SQL query
load = pd.read_sql(query,engine)
Gribouillis write Jan-03-2024, 09:15 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply
#5
(Jan-03-2024, 08:34 AM)dawid294 Wrote: This is the code
And the full traceback is...?

Please don't provide one piece of info at a time. Anyway, I would guess the problem is oracle+cx_oracle part and the question is why that

Try upgrading pandas. Check https://stackoverflow.com/q/75282511/4046632
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to combine multiple column values into 1? cubangt 15 2,872 Aug-11-2022, 08:25 PM
Last Post: cubangt
  how to catch schema error? maiya 0 1,871 Jul-16-2021, 08:37 AM
Last Post: maiya
  Missing Schema-Python Question Andwconteh 1 2,519 Jun-16-2021, 01:00 PM
Last Post: Andwconteh
  Function - Return multiple values tester_V 10 4,468 Jun-02-2021, 05:34 AM
Last Post: tester_V
  Best way to process large/complex XML/schema ? MDRI 7 6,329 May-16-2021, 09:31 PM
Last Post: snippsat
  TypeError: __init__() got an unexpected keyword argument 'value' Anldra12 7 22,696 May-11-2021, 06:35 PM
Last Post: deanhystad
  Xlsxwriter: Create Multiple Sheets Based on Dataframe's Sorted Values KMV 2 3,511 Mar-09-2021, 12:24 PM
Last Post: KMV
  Looking for help in Parse multiple XMLs and update key node values and generate Out.. rajesh3383 0 1,882 Sep-15-2020, 01:42 PM
Last Post: rajesh3383
  Assigning multiple values using tuple sivacg 2 2,285 Aug-06-2020, 10:29 PM
Last Post: perfringo
  How to pass multiple values from one sample to nc variable? Baloch 0 1,873 Jun-01-2020, 09:27 PM
Last Post: Baloch

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020