Repository: mlflow/mlflow

Issue:
[BUG] Type 'path' error with execution of mlflow experiment on databricks clusters
Thank you for submitting an issue. Please refer to our [issue policy](https://www.github.com/mlflow/mlflow/blob/master/ISSUE_POLICY.md) for additional information about bug reports. For help with debugging your code, please refer to [Stack Overflow](https://stackoverflow.com/questions/tagged/mlflow).

**Please fill in this bug report template to ensure a timely and thorough response.**

### Willingness to contribute
The MLflow Community encourages bug fix contributions. Would you or another member of your organization be willing to contribute a fix for this bug to the MLflow code base?

- [x] Yes. I can contribute a fix for this bug independently.
- [ ] Yes. I would be willing to contribute a fix for this bug with guidance from the MLflow community.
- [ ] No. I cannot contribute a bug fix at this time.

### System information
- **Have I written custom code (as opposed to using a stock example script provided in MLflow)**:
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: Linux Ubuntu 16.04
- **MLflow installed from (source or binary)**:  pip install
- **MLflow version (run ``mlflow --version``)**: 1.8.0, 1.7.2 (tool)
- **Python version**: 3.6.8
- **npm version, if running the dev UI**:
- **Exact command to reproduce**: mlflow run https://github.com/mlflow/mlflow-example.git -b databricks --backend-config cluster-spec.json --experiment-id 49221

### Describe the problem
Describe the problem clearly here. Include descriptions of the expected behavior and the actual behavior.

Error: 2020/05/12 15:29:09 INFO mlflow.projects: === Created directory /tmp/tmppcts7k18 for downloading remote URIs passed to arguments of type 'path' ===

Problem: with POST request to  Databricks API

### Code to reproduce issue
Provide a reproducible test case that is the bare minimum necessary to generate the problem.

### Other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

Solution:

Change json to params at mlflow\projects\databricks.py 

from

def _dbfs_path_exists(self, dbfs_path):
    """
    Return True if the passed-in path exists in DBFS for the workspace corresponding to the
    default Databricks CLI profile. The path is expected to be a relative path to the DBFS root
    directory, e.g. 'path/to/file'.
    """
    host_creds = databricks_utils.get_databricks_host_creds(self.databricks_profile)
    response = rest_utils.http_request(
        host_creds=host_creds, endpoint="/api/2.0/dbfs/get-status", method="GET",
        json={"path": "/%s" % dbfs_path})


def jobs_runs_get(self, databricks_run_id):
    response = self._databricks_api_request(
        endpoint="/api/2.0/jobs/runs/get", method="GET", json={"run_id": databricks_run_id})
    return json.loads(response.text)


to 

def _dbfs_path_exists(self, dbfs_path):
    """
    Return True if the passed-in path exists in DBFS for the workspace corresponding to the
    default Databricks CLI profile. The path is expected to be a relative path to the DBFS root
    directory, e.g. 'path/to/file'.
    """
    host_creds = databricks_utils.get_databricks_host_creds(self.databricks_profile)
    response = rest_utils.http_request(
        host_creds=host_creds, endpoint="/api/2.0/dbfs/get-status", method="GET",
        param={"path": "/%s" % dbfs_path})


def jobs_runs_get(self, databricks_run_id):
    response = self._databricks_api_request(
        endpoint="/api/2.0/jobs/runs/get", method="GET", param={"run_id": databricks_run_id})
    return json.loads(response.text)

### What component(s), interfaces, languages, and integrations does this bug affect?
Components 
- [ ] `area/artifacts`: Artifact stores and artifact logging
- [ ] `area/build`: Build and test infrastructure for MLflow
- [ ] `area/docs`: MLflow documentation pages
- [ ] `area/examples`: Example code
- [ ] `area/model-registry`: Model Registry service, APIs, and the fluent client calls for
Model Registry
- [ ] `area/models`: MLmodel format, model serialization/deserialization, flavors
- [x] `area/projects`: MLproject format, project running backends
- [ ] `area/scoring`: Local serving, model deployment tools, spark UDFs
- [ ] `area/tracking`: Tracking Service, tracking client APIs, autologging

Interface 
- [ ] `area/uiux`: Front-end, user experience, JavaScript, plotting
- [ ] `area/docker`: Docker use across MLflow's components, such as MLflow Projects and MLflow Models
- [ ] `area/sqlalchemy`: Use of SQLAlchemy in the Tracking Service or Model Registry
- [ ] `area/windows`: Windows support

Language 
- [ ] `language/r`: R APIs and clients
- [ ] `language/java`: Java APIs and clients

Integrations
- [ ] `integrations/azure`: Azure and Azure ML integrations
- [ ] `integrations/sagemaker`: SageMaker integrations


Problem: 



Discussion:

Resolving patch:
diff --git a/mlflow/projects/databricks.py b/mlflow/projects/databricks.py
--- a/mlflow/projects/databricks.py
+++ b/mlflow/projects/databricks.py
@@ -241,7 +241,7 @@ def jobs_runs_cancel(self, databricks_run_id):
 
     def jobs_runs_get(self, databricks_run_id):
         response = self._databricks_api_request(
-            endpoint="/api/2.0/jobs/runs/get", method="GET", json={"run_id": databricks_run_id})
+            endpoint="/api/2.0/jobs/runs/get", method="GET", params={"run_id": databricks_run_id})
         return json.loads(response.text)
 
 
diff --git a/mlflow/store/artifact/dbfs_artifact_repo.py b/mlflow/store/artifact/dbfs_artifact_repo.py
--- a/mlflow/store/artifact/dbfs_artifact_repo.py
+++ b/mlflow/store/artifact/dbfs_artifact_repo.py
@@ -44,7 +44,7 @@ def _databricks_api_request(self, endpoint, **kwargs):
     def _dbfs_list_api(self, json):
         host_creds = self.get_host_creds()
         return http_request(
-            host_creds=host_creds, endpoint=LIST_API_ENDPOINT, method='GET', json=json)
+            host_creds=host_creds, endpoint=LIST_API_ENDPOINT, method='GET', params=json)
 
     def _dbfs_download(self, output_path, endpoint):
         with open(output_path, 'wb') as f:
@@ -64,7 +64,7 @@ def _is_directory(self, artifact_path):
 
     def _dbfs_is_dir(self, dbfs_path):
         response = self._databricks_api_request(
-            endpoint=GET_STATUS_ENDPOINT, method='GET', json={'path': dbfs_path})
+            endpoint=GET_STATUS_ENDPOINT, method='GET', params={'path': dbfs_path})
         json_response = json.loads(response.text)
         try:
             return json_response['is_dir']


Test patch: