GithubHelp home page GithubHelp logo

Comments (5)

nfx avatar nfx commented on June 7, 2024

yep, it revealed another usability bug :D

image

from databricks-sdk-py.

PaulCornellDB avatar PaulCornellDB commented on June 7, 2024

OK, for completeness, noting here that I changed the title. Also, with your guidance, I now have something that is more syntactically correct:

import os
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.jobs import JobTaskSettings, NotebookTask, NotebookTaskSource

host  = os.getenv('DATABRICKS_HOST')
token = os.getenv('DATABRICKS_TOKEN')

w = WorkspaceClient(host  = host, token = token, auth_type = "pat")

w.jobs.create(
  job_name = 'my-job',
  tasks = [
    JobTaskSettings(
      description = "My job.",
      existing_cluster_id = "1128-232547-p64vrmx2",
      notebook_task = NotebookTask(
        base_parameters = {""},
        notebook_path = "/Users/[email protected]/go-fakedata",
        source = NotebookTaskSource("WORKSPACE")
      ),
      task_key = "my-key"
    )
  ]
)

However, I now get this type error:

TypeError: __init__() missing 16 required positional arguments: 'dbt_task', 'depends_on', 'email_notifications', 'job_cluster_key', 'libraries', 'max_retries', 'min_retry_interval_millis', 'new_cluster', 'pipeline_task', 'python_wheel_task', 'retry_on_timeout', 'spark_jar_task', 'spark_python_task', 'spark_submit_task', 'sql_task', and 'timeout_seconds'

None of these apply to my use case here.

from databricks-sdk-py.

nfx avatar nfx commented on June 7, 2024

@PaulCornellDB yes, i have to default to None all non-required fields in dataclasses and regenerate

from databricks-sdk-py.

nfx avatar nfx commented on June 7, 2024

one more thing: you don't have to read env vars, because it supports the same Unified Auth semantics as Go SDK. still need to add unit tests to ensure it's not breaking and compliant

host  = os.getenv('DATABRICKS_HOST')
token = os.getenv('DATABRICKS_TOKEN')

from databricks-sdk-py.

nfx avatar nfx commented on June 7, 2024

fixed in v0.0.2

from databricks-sdk-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.