Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor schema_reader.py #811

Merged
merged 10 commits into from
Apr 9, 2020
Merged

Conversation

webmat
Copy link
Contributor

@webmat webmat commented Apr 8, 2020

This is a small cleanup to clarify schema_reader.py. It would need more <3 but
that's a start.

In this PR:

  • No changes to the generated artifacts, except for the removal of the order attribute.
    This attribute was initially meant to capture and reuse the order in which
    fields are defined in the source yaml file. This was never used. Now it's gone.
  • Reorder the code in schema_reader.py to make it easier to follow the logic.
  • Move some helper functions to ecs_helpers.py
  • Add a few doc strings
  • Replace a helper function by proper use of Python, which I learned from @marshallmain's contributions. Thanks Marshall :-)

I'll continue work on #809 on top of this. But I want to separate the work a bit,
since significant underlying improvements to the tooling are still needed, to deliver #809.

@webmat webmat self-assigned this Apr 8, 2020
@webmat webmat requested a review from marshallmain April 8, 2020 19:19
@marshallmain
Copy link
Contributor

marshallmain commented Apr 8, 2020

Looks good to me except the ecs_flat.yml and ecs_nested.yml files got deleted, was that intentional?
EDIT: nevermind, the large diff didn't load by default and i read that as file deleted.

LGTM

@webmat
Copy link
Contributor Author

webmat commented Apr 9, 2020

Whoa you had me scared, there for a second 😂

Thanks

@webmat webmat merged commit 7aa8687 into elastic:master Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants