Skip to content

ImportFileResolver.resolve_file should verify if the resolved path is a file #3703

Open
@JCZuurmond

Description

@JCZuurmond

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

ImportFileResolver.resolve_file should verify if the resolved path is a file.

def resolve_file(self, path_lookup, path: Path) -> MaybeDependency:
absolute_path = path_lookup.resolve(path)
if absolute_path:
return MaybeDependency(Dependency(self._file_loader, absolute_path), [])
problem = DependencyProblem("file-not-found", f"File not found: {path.as_posix()}")
return MaybeDependency(None, [problem])

Currently, if a directory is passed to the FileResolver it is resolved successfully.

Expected Behavior

A directory should not be resolved successfully by ImportFileResolver.resolve_file

Steps To Reproduce

No response

Cloud

AWS

Operating System

macOS

Version

latest via Databricks CLI

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    2026-BUGmigrate/pythonPull requests that update Python codepythonPull requests that update Python code

    Type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions