When applying isort 5.12.0 in pre-commit within a python file, it re-orders the imports in bad. In bitbucket pipelines, the same code orders correctly.
This correct code:
from dagster import build_init_resource_context
from module1 import setting
from module1.resources.apple import AppleConnector as apple_connector
from module1.resources.apple import apple_resource
from module1.samples.apple import (
apple_schema as apple_schemas,
)
from jsonschema import validate
Gets re-ordered this way:
from dagster import build_init_resource_context
from module1.resources.apple import AppleConnector as apple_connector
from module1.resources.apple import apple_resource
from module1.samples.apple import (
apple_schema as apple_schemas,
)
from jsonschema import validate
from module1 import setting
¿Why is it happening?
In
.pre-commit-config.yamlisort configuration, I had to addmodule1as a first-party package. That avoided different interpretations in different repositories. Then pre-commit worked consistently in all the pipelines.