Hood Chatham

Results 1082 comments of Hood Chatham

The docs page is here: https://pyodide.org/en/stable/development/building-and-testing-packages.html As an example, see the numpy CI here: https://github.com/numpy/numpy/blob/main/.github/workflows/emscripten.yml

Thanks for the report. I can reproduce it with: ```js await pyodide.runPython(` import asyncio import js def exception_handler(loop, context): js.console.error(context["exception"]) print(context["exception"]) asyncio.get_event_loop().set_exception_handler(exception_handler) async def foo(): print('starting') x = 1/0 #...

I guess as a workaround, I can catch the error and filter out all errors that mention the discriminator field.

Currently I'm actually more concerned about being able to figure out what is wrong with my model: this is my key goal in using Pydantic is that it can tell...

Seems like to filter the errors I have to do: ```py v = ValidationError(None, exc.model) v._error_cache = [e for e in exc.errors() if e["loc"][-1] != "type"] raise v from None...

Though if I do: ```py def fixed_errors(depth): try: parse_depth(depth) except ValidationError as exc: exc._error_cache = [e for e in exc.errors() if e["loc"][-1] != "type"] raise else: assert False ``` then...

Aha that is why getting rid of `| None` made such a dramatic difference. I was worried it would be mad that `None` has no field `type` if we do...

Actually I am having trouble getting this to work in my real use case. I may have to search for a new minimal reproduction. But this makes me think there's...

Well the following long-winded workaround makes the error messages better for me: ```py classesByDiscriminator = {disc: {} for disc in discriminators} for cls in list(globals().values()): if not isclass(cls) or not...

I have two different unions with two different discriminators but all models in each union share one discriminator. I'm pretty confused about what the problem is since in smaller examples...