Skip to content

Commit

Permalink
is the _dataset_uri correct
Browse files Browse the repository at this point in the history
  • Loading branch information
changhiskhan committed Dec 20, 2023
1 parent 2d4d0d0 commit a463488
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ concurrency:

jobs:
linux:
if: false
timeout-minutes: 30
strategy:
matrix:
Expand Down Expand Up @@ -50,10 +51,10 @@ jobs:
strategy:
matrix:
config:
- name: x86 Mac
runner: macos-13
- name: Arm Mac
runner: macos-13-xlarge
#- name: x86 Mac
# runner: macos-13
#- name: Arm Mac
# runner: macos-13-xlarge
- name: x86 Windows
runner: windows-latest
runs-on: "${{ matrix.config.runner }}"
Expand All @@ -78,6 +79,7 @@ jobs:
- name: Run tests
run: pytest -m "not slow" -x -v --durations=30 tests
pydantic1x:
if: false
timeout-minutes: 30
runs-on: "ubuntu-22.04"
defaults:
Expand Down
1 change: 1 addition & 0 deletions python/lancedb/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,7 @@ def create(
schema = schema.with_metadata(metadata)

empty = pa.Table.from_pylist([], schema=schema)
raise ValueError(f"creating table at {tbl._dataset_uri}")
lance.write_dataset(empty, tbl._dataset_uri, schema=schema, mode=mode)
table = LanceTable(db, name)

Expand Down
11 changes: 6 additions & 5 deletions python/lancedb/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,15 @@ def get_uri_location(uri: str) -> str:
str: Location part of the URL, without scheme
"""
parsed = urlparse(uri)
if len(parsed.scheme) == 1:
# Windows drive names are parsed as the scheme
# e.g. "c:\path" -> ParseResult(scheme="c", netloc="", path="/path", ...)
# So we add special handling here for schemes that are a single character
return uri

if not parsed.netloc:
return parsed.path
else:
if len(parsed.scheme) == 1:
# Windows drive names are parsed as the scheme
# e.g. "c:\path" -> ParseResult(scheme="c", netloc="", path="/path", ...)
# So we add special handling here for schemes that are a single character
return uri
return parsed.netloc + parsed.path


Expand Down

0 comments on commit a463488

Please sign in to comment.