Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

databricks:index/job:Job resource 'my_runjob_job' has a problem: Attribute must be a whole number, got 934091005610640. Examine values at 'my_runjob_job.tasks[0].runJobTask.jobId'. #447

Closed
freud14-tm opened this issue May 3, 2024 · 2 comments
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec resolution/by-design This issue won't be fixed because the functionality is working as designed

Comments

@freud14-tm
Copy link

freud14-tm commented May 3, 2024

What happened?

Upgrading from 1.36.0 to 1.37.0 or 1.38.0, I now get this error on pulumi up:

image

See code below.

Example

import pulumi_databricks as databricks

job = databricks.Job(
    "my_job",
    name="my_job",
    job_clusters=[
        databricks.JobJobClusterArgs(
            job_cluster_key="my_cluster_key",
            new_cluster=databricks.JobJobClusterNewClusterArgs(spark_version="13.3.x-scala2.12", node_type_id="i3.xlarge"),
        )
    ],
    tasks=[
        databricks.JobTaskArgs(
            task_key="my_key",
            job_cluster_key="my_cluster_key",
            notebook_task=databricks.JobTaskNotebookTaskArgs(notebook_path="/Workspace/test"),
        )
    ],
)


runjob_job = databricks.Job(
    "my_runjob_job",
    name="my_runjob_job",
    tasks=[
        databricks.JobTaskArgs(
            task_key="my_task",
            run_job_task=databricks.JobTaskRunJobTaskArgs(job_id=job.id),
        )
    ],
)

Output of pulumi about

CLI          
Version      3.105.0
Go Version   go1.21.6
Go Compiler  gc

Plugins
NAME                VERSION
databricks          1.37.0
databricks-project  0.3.17+dev6
python              unknown

Host     
OS       ubuntu
Version  22.04
Arch     x86_64

This project is written in python: executable='/home/freud/.pyenv/shims/python3' version='3.10.10'

Current Stack: local

TYPE                         URN
pulumi:pulumi:Stack          urn:pulumi:local::pulumi-databricks-project-test::pulumi:pulumi:Stack::pulumi-databricks-project-test-local
pulumi:providers:databricks  urn:pulumi:local::pulumi-databricks-project-test::pulumi:providers:databricks::default_1_37_0
databricks:index/job:Job     urn:pulumi:local::pulumi-databricks-project-test::databricks:index/job:Job::my_job


Found no pending operations associated with local

Backend        
Name           ubuntu
URL            file://~
User           freud
Organizations  
Token type     personal

Pulumi locates its logs in /tmp by default
warning: Failed to get information about the Pulumi program's dependencies: illegal semver returned by language host: pulumi-databricks-project@0.3.17.dev6: Invalid character(s) found in patch number "17.dev6

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@freud14-tm freud14-tm added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels May 3, 2024
@iwahbe
Copy link
Member

iwahbe commented May 3, 2024

Hi @freud14-tm. I'm sorry that you're hitting this issue. This looks like a type mismatch, and running a type checker bears that out:

$ pyright
__main__.py:28:66 - error: Argument of type "Output[str]" cannot be assigned to
 parameter "job_id" of type "Input[int]" in function "__init__"
    Type "Output[str]" cannot be assigned to type "Input[int]"
      "Output[str]" is incompatible with "int"
      "Output[str]" is incompatible with protocol "Awaitable[int]"
        "__await__" is not present
      "Output[str]" is incompatible with "Output[int]"
        Type parameter "T_co@Output" is covariant, but "str" is not a subtype of "int"
          "str" is incompatible with "int" (reportGeneralTypeIssues)
1 error, 0 warnings, 0 informations 

To align the types, you can make this change:

 runjob_job = databricks.Job(
     "my_runjob_job",
     name="my_runjob_job",
     tasks=[
         databricks.JobTaskArgs(
             task_key="my_task",
-            run_job_task=databricks.JobTaskRunJobTaskArgs(job_id=job.id),
+            run_job_task=databricks.JobTaskRunJobTaskArgs(job_id=job.id.apply(int)),
         )
     ],
 )

This would have been caught by pulumi/pulumi-terraform-bridge#1328, which will roll out with the next bridge release.

@iwahbe iwahbe added resolution/by-design This issue won't be fixed because the functionality is working as designed and removed needs-triage Needs attention from the triage team labels May 3, 2024
@iwahbe iwahbe self-assigned this May 3, 2024
@iwahbe iwahbe closed this as completed May 3, 2024
@freud14-tm
Copy link
Author

Hi @iwahbe , any ETA for the next bridge release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec resolution/by-design This issue won't be fixed because the functionality is working as designed
Projects
None yet
Development

No branches or pull requests

2 participants