Skip to content

Add option to preserve LookML file comments in lkml.load #103

Description

@yaelmi3

Some workflows need access to the comments at the top of a LookML file (e.g., autogenerated notes or metadata). Currently, lkml.load() discards this preamble.

Proposal:
Add an optional flag (e.g. keep_prefix) so the returned dict can include the raw comment/whitespace preamble:

lkml.load(raw, keep_prefix=True)
# => {"views": [...], "_prefix": "# This file is generated automatically\n..."}

suggested implementation can be found in this PR :)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions