Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ADD: Fallback method to get cluster_id from task instance. (#16508)
## Summary & Motivation Fixes: #16506 Sometimes run.cluster_intance is None, so we instead attempt to get it from run.tasks[0].cluster_instance, since we use singleton run tasks in this step launcher this should be correct. To round it out, I've also added a check.str_param check to the method. ## How I Tested These Changes With changes introduced in this pr; ran: ```py In [1]: import os In [2]: import logging In [3]: from dagster_databricks import DatabricksClient, DatabricksJobRunner In [4]: logger = logging.getLogger() In [5]: logger.addHandler(logging.StreamHandler()) In [6]: logger.setLevel("INFO") In [7]: runner = DatabricksJobRunner(os.environ['DATABRICKS_HOST'], os.environ['DATABRICKS_TOKEN']) # Actually ran this with a real cluster id that was failing # under current methodology. In [8]: runner.retrieve_logs_for_run_id(logger, 123456) ``` Which resulted in the logs being pushed to the logger. --------- Co-authored-by: Sean Mackesey <[email protected]>
- Loading branch information