TypeError: __init__() got an unexpected keyword argument 'ordered'
See original GitHub issueSo I’m using the following: marshmallow (3.0.0) marshmallow-sqlalchemy (0.17.0) psycopg2 (2.8.3) SQLAlchemy (1.3.7)
I’ve got the following: _Tables.py
person_table = Table(
'person',
Base.metadata,
Column('id', UUID(as_uuid=True), primary_key=True, nullable=False, default=sqlalchemy.text('uuid_generate_v4()'), server_default=sqlalchemy.text('uuid_generate_v4()')),
Column('display_name', String(length=255), nullable=False),
Column('email', String(length=255), unique=True, nullable=False),
Column('first_name', String(length=255), nullable=False),
Column('image', Text),
Column('last_name', String(length=255), nullable=False),
Column('phash', Text))
SAObjects.py
class Person(Base):
def __repr__(self):
return (
"<Person id='" + str(self.id)
+ "' first_name='" + self.first_name
+ "' last_name='" + self.last_name + "'>")
__table__ = person_table
_Schema.py
class BaseOpts(ModelSchemaOpts):
def __init__(self, meta):
if not hasattr(meta, "sqla_session"):
meta.sqla_session = SqlSessionSingleton.get_instance()
super(BaseOpts, self).__init__(meta)
class BaseSchema(ModelSchema):
OPTIONS_CLASS = BaseOpts
class PersonSchema(BaseSchema):
class Meta:
model = Person
but I am getting the following:
$ python3 db_tester.py
Traceback (most recent call last):
File "db_tester.py", line 4, in <module>
from ._Schema import PersonSchema
File "#####-venv/myproject/tests/myproject/_Schema.py", line 21, in <module>
class BaseSchema(ModelSchema):
File "#####-venv/lib/python3.7/site-packages/marshmallow/schema.py", line 112, in __new__
klass.opts = klass.OPTIONS_CLASS(meta, ordered=ordered)
TypeError: __init__() got an unexpected keyword argument 'ordered'
Did I screw something up?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
python - TypeError: __init__() got an unexpected keyword ...
Based on the comments, you're running Django 4.0 with an old version of AllAuth. So you just need to update AllAuth and should...
Read more >TypeError - unexpected keyword argument 'ordered' #597
When running our tests with marshmallow-2.13.2 and marshmallow-jsonapi-0.10.2, we encountered this stack trace: tests/fa/test_updater.py:3: ...
Read more >TypeError: __init__() got an unexpected keyword argument ...
After completing all the procedure, the following error was thrown while running run.py TypeError: init() got an unexpected keyword argument ...
Read more >Flask got an unexpected keyword argument path
8', TypeError: init() got an unexpected keyword argument 'websocket'` if try to simulate this error, it would not generate, this appear out of...
Read more >TypeError: Field.__init__() got an unexpected keyword ...
Dijango series part 1 section 3 (building a data model) after adding store & tags apps , if i tried to create a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Your
BaseOpts
constructor needs to acceptordered
or*args, **kwargs
.how would one do this without creating a shared base model