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

Update data_stream.yml with top level type: group #2414

Merged
merged 2 commits into from
Dec 27, 2024

Conversation

Omarimcblack
Copy link
Contributor

when running version v1.12.2 with the flag -oss

python3 scripts/generator.py  --include <MY-SCHEMAS> --template-settings <MY-TEMPLATE> --mapping-settings <MY-MAPPINGS> --oss

the following error occured

Traceback (most recent call last):
  File "ecs/scripts/generator.py", line 112, in <module>
    main()
    ~~~~^^
  File "ecs/scripts/generator.py", line 52, in main
    oss.fallback(fields)
    ~~~~~~~~~~~~^^^^^^^^
  File "ecs/scripts/schema/oss.py", line 26, in fallback
    visitor.visit_fields(fields, field_func=perform_fallback)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "ecs/scripts/schema/visitor.py", line 19, in visit_fields
    field_func(details)
    ~~~~~~~~~~^^^^^^^^^
  File "ecs/scripts/schema/oss.py", line 32, in perform_fallback
    fallback_type = TYPE_FALLBACKS.get(field['field_details']['type'])
                                       ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'type'

this error was fixed when adding the type: group top level field to schemas/data_stream.yml, and the expected functionality achieved, correct fallback of:

TYPE_FALLBACKS = {
    'constant_keyword': 'keyword',
    'wildcard': 'keyword',
    'version': 'keyword',
    'match_only_text': 'text',
    'flattened': 'object'
}

  • Have you signed the contributor license agreement?
  • Have you followed the contributor guidelines?
  • For proposing substantial changes or additions to the schema, have you reviewed the RFC process?
  • If submitting code/script changes, have you verified all tests pass locally using make test?
  • If submitting schema/fields updates, have you generated new artifacts by running make and committed those changes?
  • Is your pull request against main? Unless there is a good reason otherwise, we prefer pull requests against main and will backport as needed.
  • Have you added an entry to the CHANGELOG.next.md?

@Omarimcblack Omarimcblack requested a review from a team as a code owner December 11, 2024 13:05
Copy link

cla-checker-service bot commented Dec 11, 2024

💚 CLA has been signed

@mjwolf
Copy link
Contributor

mjwolf commented Dec 27, 2024

Hi @Omarimcblack, if you're willing to, could you please sign the contributor agreement from the @cla-checker-service comment above?

@Omarimcblack
Copy link
Contributor Author

Hi @Omarimcblack, if you're willing to, could you please sign the contributor agreement from the @cla-checker-service comment above?

Hi @mjwolf i have signed the agreement, are you able to re run checks?

@mjwolf mjwolf merged commit 96d8df8 into elastic:main Dec 27, 2024
2 checks passed
@mjwolf
Copy link
Contributor

mjwolf commented Dec 27, 2024

@Omarimcblack thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants