Skip to content

Commit

Permalink
fix(python): correct typechecking error (#1604)
Browse files Browse the repository at this point in the history
  • Loading branch information
lidavidm authored Mar 8, 2024
1 parent 0b50e4f commit 0ca0f9e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
24 changes: 19 additions & 5 deletions ci/scripts/python_typecheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,39 @@ set -e
main() {
local -r source_dir="${1}"

local status=0

if [[ "${BUILD_DRIVER_FLIGHTSQL}" -gt 0 ]]; then
pyright ${PYRIGHT_OPTIONS} "${source_dir}/python/adbc_driver_flightsql"
if ! pyright ${PYRIGHT_OPTIONS} "${source_dir}/python/adbc_driver_flightsql"; then
status=1
fi
fi

if [[ "${BUILD_DRIVER_MANAGER}" -gt 0 ]]; then
pyright ${PYRIGHT_OPTIONS} "${source_dir}/python/adbc_driver_manager"
if ! pyright ${PYRIGHT_OPTIONS} "${source_dir}/python/adbc_driver_manager"; then
status=1
fi
fi

if [[ "${BUILD_DRIVER_POSTGRESQL}" -gt 0 ]]; then
pyright ${PYRIGHT_OPTIONS} "${source_dir}/python/adbc_driver_postgresql"
if ! pyright ${PYRIGHT_OPTIONS} "${source_dir}/python/adbc_driver_postgresql"; then
status=1
fi
fi

if [[ "${BUILD_DRIVER_SQLITE}" -gt 0 ]]; then
pyright ${PYRIGHT_OPTIONS} "${source_dir}/python/adbc_driver_sqlite"
if ! pyright ${PYRIGHT_OPTIONS} "${source_dir}/python/adbc_driver_sqlite"; then
status=1
fi
fi

if [[ "${BUILD_DRIVER_SNOWFLAKE}" -gt 0 ]]; then
pyright ${PYRIGHT_OPTIONS} "${source_dir}/python/adbc_driver_snowflake"
if ! pyright ${PYRIGHT_OPTIONS} "${source_dir}/python/adbc_driver_snowflake"; then
status=1
fi
fi

return $status
}

main "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def _driver_path() -> str:
driver = "adbc_driver_flightsql"

# Wheels bundle the shared library
root = importlib.resources.files(__package__)
root = importlib.resources.files(driver)
# The filename is always the same regardless of platform
entrypoint = root.joinpath(f"lib{driver}.so")
if entrypoint.is_file():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _driver_path() -> str:
driver = "adbc_driver_postgresql"

# Wheels bundle the shared library
root = importlib.resources.files(__package__)
root = importlib.resources.files(driver)
# The filename is always the same regardless of platform
entrypoint = root.joinpath(f"lib{driver}.so")
if entrypoint.is_file():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _driver_path() -> str:
driver = "adbc_driver_snowflake"

# Wheels bundle the shared library
root = importlib.resources.files(__package__)
root = importlib.resources.files(driver)
# The filename is always the same regardless of platform
entrypoint = root.joinpath(f"lib{driver}.so")
if entrypoint.is_file():
Expand Down
2 changes: 1 addition & 1 deletion python/adbc_driver_sqlite/adbc_driver_sqlite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _driver_path() -> str:
driver = "adbc_driver_sqlite"

# Wheels bundle the shared library
root = importlib.resources.files(__package__)
root = importlib.resources.files(driver)
# The filename is always the same regardless of platform
entrypoint = root.joinpath(f"lib{driver}.so")
if entrypoint.is_file():
Expand Down

0 comments on commit 0ca0f9e

Please sign in to comment.