Skip to content

Instantly share code, notes, and snippets.

@elect86
Created March 27, 2024 12:49
Show Gist options
  • Select an option

  • Save elect86/53031599c73b8588920cc9e6ed8877a8 to your computer and use it in GitHub Desktop.

Select an option

Save elect86/53031599c73b8588920cc9e6ed8877a8 to your computer and use it in GitHub Desktop.
testApp.py:34 (test_pass)
lakefs_setup_branch = Branch(repository="test-repo", id="main")
def test_pass(lakefs_setup_branch):
# .prefix('local://mnt/data/test_resources/test_pass/', destination='datasets') \
# .prefix('s3://bucket1/data', destination='/') \
# print(os.path.exists("/mnt/data/test_resources/test_pass/newest_pc2/flame_at_noctua2-naughty_subroutines.png"))
# lakefs_setup_branch.import_data(commit_message='added test data') \
# .object("local:///mnt/data/test_resources/test_pass/newest_pc2/flame_at_noctua2-naughty_subroutines.png",
# "data/flame_at_noctua2-naughty_subroutines.png") \
# .run()
importer = lakefs_setup_branch.import_data(commit_message='added test data')
importer.object(
"local:///mnt/data/test_resources/test_pass/newest_pc2/flame_at_noctua2-naughty_subroutines.png",
"data/flame_at_noctua2-naughty_subroutines.png")
importer.start()
sleep(2)
> importer.wait()
testApp.py:49:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../venv/lib/python3.11/site-packages/lakefs/import_manager.py:150: in wait
res = asyncio.run(self._wait_for_completion(poll_interval))
/usr/lib/python3.11/asyncio/runners.py:190: in run
return runner.run(main)
/usr/lib/python3.11/asyncio/runners.py:118: in run
return self._loop.run_until_complete(task)
/usr/lib/python3.11/asyncio/base_events.py:653: in run_until_complete
return future.result()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <lakefs.import_manager.ImportManager object at 0x7f58f0862ad0>
poll_interval = datetime.timedelta(seconds=2)
async def _wait_for_completion(self, poll_interval: timedelta) -> lakefs_sdk.ImportStatus:
while True:
with api_exception_handler():
resp = self._client.sdk_client.import_api.import_status(repository=self._repo_id,
branch=self._branch_id,
id=self._import_id)
if resp.completed:
return resp
if resp.error is not None:
> raise ImportManagerException(f"Import Error: {resp.error.message}")
E lakefs.exceptions.ImportManagerException: Import Error: import error: error on ingest: forbidden
../venv/lib/python3.11/site-packages/lakefs/import_manager.py:132: ImportManagerException
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment