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"
|
||||
)
|
||||
|
||||
// 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
|
||||
// from locations.json
|
||||
|
@ -23,9 +23,9 @@ const generatedFileName = "__generated_by_python__.yml"
|
|||
//
|
||||
// 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.tasks[0].task_key", "file": "src/examples/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_0", "file": "resources/job_0.py", "line": 3, "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": "resources/job_1.py", "line": 5, "column": 7}
|
||||
//
|
||||
// - 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)
|
||||
|
||||
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.
|
||||
if filepath.Base(location.File) == generatedFileName {
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue