Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bundle/artifacts/whl/autodetect.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ func (m *detectPkg) Name() string {
}

func (m *detectPkg) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnostics {
wheelTasks := libraries.FindAllWheelTasksWithLocalLibraries(b)
if len(wheelTasks) == 0 {
log.Infof(ctx, "No local wheel tasks in databricks.yml config, skipping auto detect")
tasks := libraries.FindTasksWithLocalLibraries(b)
Comment thread
andrewnester marked this conversation as resolved.
if len(tasks) == 0 {
log.Infof(ctx, "No local tasks in databricks.yml config, skipping auto detect")
return nil
}
log.Infof(ctx, "Detecting Python wheel project...")
Expand Down
2 changes: 1 addition & 1 deletion bundle/artifacts/whl/from_libraries.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (*fromLibraries) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnost
return nil
}

tasks := libraries.FindAllWheelTasksWithLocalLibraries(b)
tasks := libraries.FindTasksWithLocalLibraries(b)
Comment thread
andrewnester marked this conversation as resolved.
for _, task := range tasks {
for _, lib := range task.Libraries {
matchAndAdd(ctx, lib.Whl, b)
Expand Down
6 changes: 1 addition & 5 deletions bundle/libraries/libraries.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,14 @@ func isEnvsWithLocalLibraries(envs []jobs.JobEnvironment) bool {
return false
}

func FindAllWheelTasksWithLocalLibraries(b *bundle.Bundle) []*jobs.Task {
func FindTasksWithLocalLibraries(b *bundle.Bundle) []*jobs.Task {
tasks := findAllTasks(b)
envs := FindAllEnvironments(b)

wheelTasks := make([]*jobs.Task, 0)
Comment thread
andrewnester marked this conversation as resolved.
Outdated
for k, jobTasks := range tasks {
for i := range jobTasks {
task := &jobTasks[i]
if task.PythonWheelTask == nil {
continue
}

if isTaskWithLocalLibraries(*task) {
wheelTasks = append(wheelTasks, task)
}
Comment thread
andrewnester marked this conversation as resolved.
Expand Down
2 changes: 1 addition & 1 deletion bundle/python/warning.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func isPythonWheelWrapperOn(b *bundle.Bundle) bool {
}

func hasIncompatibleWheelTasks(ctx context.Context, b *bundle.Bundle) bool {
tasks := libraries.FindAllWheelTasksWithLocalLibraries(b)
tasks := libraries.FindTasksWithLocalLibraries(b)
for _, task := range tasks {
if task.NewCluster != nil {
if lowerThanExpectedVersion(ctx, task.NewCluster.SparkVersion) {
Expand Down
5 changes: 2 additions & 3 deletions bundle/tests/python_wheel/python_wheel_no_artifact/bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ resources:
tasks:
- task_key: TestTask
existing_cluster_id: "0717-aaaaa-bbbbbb"
python_wheel_task:
Comment thread
andrewnester marked this conversation as resolved.
package_name: "my_test_code"
entry_point: "run"
notebook_task:
notebook_path: "/notebook.py"
libraries:
- whl: ./dist/*.whl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Databricks notebook source

print("Hello, World!")