<#2319 meltano config &lt;plugin&gt; init> Issue c...
# meltano-repo-activity
g
#2319 meltano config <plugin> init Issue created by MeltyBot Migrated from GitLab: https://gitlab.com/meltano/meltano/-/issues/2363 Originally created by @andrewstewart on 2020-09-25 175539 --- Problem to solve Some plugin configurations require nesting structures that may be too complex to set with
meltano config <plugin> set <name>
or to manually insert into
meltano.yml
by hand. An option to initialize the skeleton config in
meltano.yml
could be a convenient way to reduce complexity of setting up complex plugin configurations. Target audience (For whom are we doing this? Include a persona) The target audience would be users who are setting up plugins with complex configurations. Further details (Include use cases, benefits, and/or goals) An example use case would be a user trying to setup the tap-spreadsheets-anywhere extractor, which has a complex
tables
array:
Copy code
{
    "tables": [
        {
            "path": "s3://my-s3-bucket",
            "name": "target_table_name",
            "pattern": "subfolder/common_prefix.*",
            "start_date": "2017-05-01T00:00:00Z",
            "key_properties": [],
            "format": "csv",
            "delimiter": "|",
            "quotechar": '"',
            "universal_newlines": false,
            "sample_rate": 10,
            "max_sampling_read": 2000,
            "max_sampled_files": 3,
            "prefer_number_vs_integer": true,
            "selected": true,

            // for any field in the table, you can hardcode the json schema datatype to override
            // the schema infered through discovery mode. 
            // *Note Meltano users* - the scheam override support delivered in Meltano v1.41.1 is more robust
            //  and should be preferred to this tap-specific override functionality.  
            "schema_overrides": {
                "id": {
                    "type": ["null", "integer"],
                },
                // if you want the tap to enforce that a field is not nullable, you can do it like so:
                "first_name": {
                    "type": "string",
                }
            }
        },
        {
            "path": "sftp://username:password@host//path/file",
            "name": "another_table_name",
            "pattern": "subdir/.*User.*",
            "start_date": "2017-05-01T00:00:00Z",
            "key_properties": ["id"],
            "format": "excel", 
            // you must specify the worksheet name to pull from in your xls(x) file.
            "worksheet_name": "Names"
        }
    ]
}
Currently, as best I understand, a user would have to either construct that entire tables array in a single string passed to `meltano config tap-spreadsheets-anywhere set tables '{...}', or manually author that structure into their
meltano.yml
file. Proposal (How are we going to solve the problem? Try to include the user journey) One idea proposed here is to add a CLI option to initialize a blank default skeleton for a plugin's configuration (assuming this information is somehow associated with the plugin's discovery metadata?)
meltano config <plugin> init
or
meltano config <plugin> init <name>
Running this command would insert the blank config skeleton into the appropriate location within the
meltano.yml
file, leaving the user with the much simpler task of filling in any necessary blanks. What does success look like, and how can we measure that? (Define both the success metrics and acceptance criteria. Note that success metrics indicate the desired business outcomes, while acceptance criteria indicate when the solution is working correctly. If there is no way to measure success, link to an issue that will implement a way to measure this) Regression test (Ensure the feature doesn't cause any regressions) • Write adequate test cases and submit test results • Test results should be reviewed by a person from the team Links / references Please note that this was taken from GitLab, to be changed accordingly meltano/meltano