fix(ingest): ensure that LookML files are always parsed in the same order #2966
+3
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Metadata ingestion for LookML requires a few operations that list files using
glob.glob()
. This PR proposes sorting those lists of files by name, to ensure that given the same set of.lkml
files,datahub ingest
will process them in the same order every time.The ordering of results from
glob.glob()
is not guaranteed to be the same on different filesystems. See https://stackoverflow.com/a/6773661 for more details.How this improves
datahub ingest
I faced a really difficult bug today. I created a docker image with an entrypoint that ran something like
datahub ingest -c /recipes/recipe.yaml
.I found that I got different behavior in these two methods of running containers using that image:
lookml-files.git
and mount it into a container at/model-files
Eventually, I discovered a separate bug where the order of parsing mattered (proposed fix in #2965 ). A strong guarantee that
datahub ingest
processes files in the same order every time would have sped up my debugging of that issue, and would have given me higher confidence that ingestion running in k8s would match the behavior I saw in my development environment.Checklist
Thanks for your time and consideration!