Closed dada-engineer closed 8 months ago
linting fails because black and flake8 have a different opinion on how
class PyType(str):
...
should be formatted.
black now wants to do:
class PyType(str): ...
But flake8 then complains that there are multiple statements on one line.
So this flake8 vs black conflict. Is there a way that we can configure either of the tools to handle this OK?
So this flake8 vs black conflict. Is there a way that we can configure either of the tools to handle this OK?
I guess this comment makes sense: https://github.com/psf/black/issues/4213#issuecomment-1928364118
TLDR; deactivate flake8 rule for stuff that is handled by formatter.
Got you, so that should be a change in .flake8
file?
Looks like it, should I add this here?
Had some issue with mypy as well, fixed in same commit.
Love it!
Are we good to merge?
I am okay with it, but since I removed it lists of pydantic objects will not yet work. I'll open a new issue for this or a second PR later.
Understood. Many thanks for this contribution.
Thanks for making this fix! Unfortunately, I'm stuck on py-avro-schema v2 (and upgrading is going to be very hard I'm afraid). Any suggestions on how I could try and patch v2 or work around this issue?
I tried patching the make_default logic into v2, but it doesn't seem to work unfortunately...
Any hints would be highly appreciated 🙏
NVM. Gotten it to work and posted it for others here: https://github.com/jpmorganchase/py-avro-schema/issues/64#issuecomment-2388957280
This allows pydantic BaseModels as default values.
Fixes #64