Code Monkey home page Code Monkey logo

Comments (6)

andrewmchen avatar andrewmchen commented on July 30, 2024

This is a funny quick with our protobuf serializer. If a repeated is empty then it will not serialize the key at all. Do you want to make a PR? It should be as simple as checking if the API responds without a jobs key.

from databricks-cli.

hithwen avatar hithwen commented on July 30, 2024

Yeah, but my previous attempt to contribute to this project has been completely ignored: #169 so I'll pass

from databricks-cli.

andrewmchen avatar andrewmchen commented on July 30, 2024

Sorry about that. I'll take a look at that PR...

from databricks-cli.

zhaoxingL avatar zhaoxingL commented on July 30, 2024

@andrewmchen Can this be fixed? I can make a PR towards it. Today when I try to use stack_cli to create a job on a brand new workspace with no jobs, it returns KeyError again when checking if there're duplicate jobs using the Jobs API. When I add a Untitiled job as placeholder it was successful immediately. Since this is frequently used I think maybe it's worth fixing it.

StackTrace:

  File "/Users/andrewli/universe/bazel-bin/eng-tools/etl/db_cli/eng_tools/etl/stack_cli.py", line 307, in deploy
  File "/Users/andrewli/universe/bazel-bin/eng-tools/etl/db_cli/eng_tools/etl/stack_cli.py", line 60, in deploy_stack
  File "/Users/andrewli/.pex/install/databricks_cli-0.8.3.dev0-py2.py3-none-any.whl.5cf47497201f5d3e15e9328502b026532ab17b5b/databricks_cli-0.8.3.dev0-py2.py3-none-any.whl/databricks_cli/stack/api.py", line 123, in deploy
    **kwargs)
  File "/Users/andrewli/.pex/install/databricks_cli-0.8.3.dev0-py2.py3-none-any.whl.5cf47497201f5d3e15e9328502b026532ab17b5b/databricks_cli-0.8.3.dev0-py2.py3-none-any.whl/databricks_cli/stack/api.py", line 179, in _deploy_resource
    headers=headers)
  File "/Users/andrewli/.pex/install/databricks_cli-0.8.3.dev0-py2.py3-none-any.whl.5cf47497201f5d3e15e9328502b026532ab17b5b/databricks_cli-0.8.3.dev0-py2.py3-none-any.whl/databricks_cli/stack/api.py", line 256, in _deploy_job
    job_id = self._put_job(job_settings, headers=headers)
  File "/Users/andrewli/.pex/install/databricks_cli-0.8.3.dev0-py2.py3-none-any.whl.5cf47497201f5d3e15e9328502b026532ab17b5b/databricks_cli-0.8.3.dev0-py2.py3-none-any.whl/databricks_cli/stack/api.py", line 272, in _put_job
    jobs_same_name = self.jobs_client._list_jobs_by_name(job_name, headers=headers)
  File "/Users/andrewli/.pex/install/databricks_cli-0.8.3.dev0-py2.py3-none-any.whl.5cf47497201f5d3e15e9328502b026532ab17b5b/databricks_cli-0.8.3.dev0-py2.py3-none-any.whl/databricks_cli/jobs/api.py", line 51, in _list_jobs_by_name
    jobs = self.list_jobs(headers=headers)['jobs']
KeyError: 'jobs'

from databricks-cli.

andrewmchen avatar andrewmchen commented on July 30, 2024

@zhaoxingL Could you try #230?

from databricks-cli.

zhaoxingL avatar zhaoxingL commented on July 30, 2024

@andrewmchen I've tested this and it now can return empty list instead of throwing KeyError with existing workspaces with empty job list. Should be good to merge.

from databricks-cli.

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.