implementation of new lightbeam create functionality#56
Merged
Conversation
update `lightbeam create` branch to latest main
lightbeam create functionalitylightbeam create functionality
ejoranlienea
approved these changes
Jul 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a PR with an implementation of a new function,
lightbeam create(typically used with a-sselector), which, in the current dir, derived from the Ed-Fi API's Swagger:earthmover.ymlwith emptysourcesandtransformationsbutdestinationsfor each selected endpoint, plus comments indicating what column names and data types/values are required, and the required grain of the table (based on Swagger isIdentity fields)templates/*.jsontfor each selected endpoint, with skeleton JSON that includes all the required fields (including nested ones), optional fields wrapped in conditionals, and comments with some of the property metadata from Swagger, like type, description, isIdentity, etc.earthmover.yml'ssourcesandtransformations(The idea for this feature arose from discussions with a developer who figured out how to use earthmover but was struggling to learn how to construct the Ed-Fi payloads.
lightbeam createwill help scaffold developers by automatically creating some of the boilerplate code required for an earthmover Ed-Fi project.)This implements
api.get_params_for_endpoint(..., type='all')to build the sample payload for each endpoint, such as{ "property_bool": true, "property_int": 1, "property_float": 1.0, "property_string": "string", "property_date": "date", "property_string_optional": "string", "property_descriptor": "uri://ed-fi.org/SomeDescriptor#SomeValue", "property_object": { "property_object_1": "string", "property_object_2": "string" }, "property_array": [ { "property_array_1": "string", "property_array_2": "string" } ] }which can then be turned into a JSON template such as
{ "property_bool": {{property_bool}}, "property_int": {{property_int}}, "property_float": {{property_float}}, "property_string": "{{property_string}}", "property_date": "{{property_date}}", {% if property_string_optional %} "property_string_optional": "{{property_string_optional}}", {% endif %} "property_descriptor": "uri://ed-fi.org/SomeDescriptor#{{property_descriptor}}", "property_object": { "property_object_1": "{{property_object_1}}", "property_object_2": "{{property_object_2}}" }, "property_array": [ {% for item in property_array %} { "property_array_1": "{{item.property_array_1}}", "property_array_2": "{{item.property_array_2}}" } {% if not loop.last %},{% endif %} {% endfor %} ] }