looker-open-source / gzr

A Command Line Tool for Looker Content Management
MIT License
120 stars 37 forks source link

Whitespace in Dashboard title is not properly handled when creating a json file #211

Closed jeheon-k closed 1 year ago

jeheon-k commented 1 year ago

Based on the document, the whitespace in the dashboard title should be converted to "\ ", in order for the import method to interpret it as a single entity. However, this approach does not appear to be effective.

For instance, if I generate a JSON file (using cat) for a dashboard titled "New Dashboard," the resulting file name becomes Dashboard_19603_New Dashboard.json. When this file name is used as input for the import method, an error occurs because the whitespace is interpreted as a separator between arguments.

Here is the error message: ERROR: "gzr dashboard import" was called with arguments ["PATH/Dashboard_19603_New", "Dashboard.json", "15"]

Although manually replacing the whitespace with a different character (e.g., '_') resolves the problem, it poses a challenge to our automation plan.

Is there a possibility of modifying the code so that all whitespace characters in the dashboard title are replaced with the appropriate special character?

drstrangelooker commented 1 year ago

If you put the name in quotes it handles that properly.

So "Dashboard_19603_New Dashboard.json" will be interpreted fine.

jeheon-k commented 1 year ago

@drstrangelooker Thanks for the information. Putting the entire file path in quotes works. Does this mean then the remained whitespace in the file name is intended behavior, contrary to what is stated in the document?

drstrangelooker commented 1 year ago

The backslash space \ and the quotes are both standard ways of the shell handling filenames with spaces in them. Neither has anything to do with gazer.