mirror of https://github.com/databricks/cli.git
Update comments
This commit is contained in:
parent
4c89292887
commit
b6fa16e1d0
|
@ -9,7 +9,7 @@ import (
|
||||||
"github.com/databricks/cli/libs/dyn"
|
"github.com/databricks/cli/libs/dyn"
|
||||||
)
|
)
|
||||||
|
|
||||||
// generatedFileName is used as the virtual file name for YAML generated by PyDABs.
|
// generatedFileName is used as the virtual file name for YAML generated by Python code.
|
||||||
//
|
//
|
||||||
// mergePythonLocations replaces dyn.Location with generatedFileName with locations loaded
|
// mergePythonLocations replaces dyn.Location with generatedFileName with locations loaded
|
||||||
// from locations.json
|
// from locations.json
|
||||||
|
@ -23,9 +23,9 @@ const generatedFileName = "__generated_by_python__.yml"
|
||||||
//
|
//
|
||||||
// For example, with locations.json:
|
// For example, with locations.json:
|
||||||
//
|
//
|
||||||
// {"path": "resources.jobs.job_0", "file": "src/examples/job_0.py", "line": 3, "column": 5}
|
// {"path": "resources.jobs.job_0", "file": "resources/job_0.py", "line": 3, "column": 5}
|
||||||
// {"path": "resources.jobs.job_0.tasks[0].task_key", "file": "src/examples/job_0.py", "line": 10, "column": 5}
|
// {"path": "resources.jobs.job_0.tasks[0].task_key", "file": "resources/job_0.py", "line": 10, "column": 5}
|
||||||
// {"path": "resources.jobs.job_1", "file": "src/examples/job_1.py", "line": 5, "column": 7}
|
// {"path": "resources.jobs.job_1", "file": "resources/job_1.py", "line": 5, "column": 7}
|
||||||
//
|
//
|
||||||
// - resources.jobs.job_0.tasks[0].task_key is located at job_0.py:10:5
|
// - resources.jobs.job_0.tasks[0].task_key is located at job_0.py:10:5
|
||||||
//
|
//
|
||||||
|
@ -70,7 +70,7 @@ func mergePythonLocations(value dyn.Value, locations *pythonLocations) (dyn.Valu
|
||||||
newLocations = append(newLocations, newLocation)
|
newLocations = append(newLocations, newLocation)
|
||||||
|
|
||||||
for _, location := range value.Locations() {
|
for _, location := range value.Locations() {
|
||||||
// When loaded, dyn.Value created by PyDABs use the virtual file path as their location,
|
// When loaded, dyn.Value created by Python code uses the virtual file path as their location,
|
||||||
// we replace it with newLocation.
|
// we replace it with newLocation.
|
||||||
if filepath.Base(location.File) == generatedFileName {
|
if filepath.Base(location.File) == generatedFileName {
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue