important-grass-6350
01/29/2024, 2:35 PM__init__() got an unexpected keyword argument 'connection'
We are using the 'production flow' approach of registration pattern.
1. We have poetry project with the workflows and Docker file.
2. In poetry project we are using the below dependencies.
[tool.poetry.dependencies]
python = "~3.9"
botocore = "1.31.17"
flytekit = "1.10.2"
flytekitplugins-deck-standard = "1.10.2"
flytekitplugins-papermill = "1.10.2"
flytekitplugins-pod = "1.10.2"
kubernetes = "^28.1.0"
pyathena = "3.1.0"
3. When we build the docker and running the python code inside the docker its working fine.
from flytekit import task, workflow
from pyathena import connect
from pyathena.pandas.cursor import PandasCursor
@task
def test1():
access_key = ""
secret_key = ""
conn = connect(aws_access_key_id=access_key,
aws_secret_access_key=secret_key,
s3_staging_dir="<s3://drd-029652062076-28e0/>",region_name="us-east-1",
cursor_class=PandasCursor).cursor()
query = "SELECT * FROM default.flytetesting limit 10;"
df = conn.execute(query).as_pandas()
print(df.head(5))
@workflow
def hello_world_wf():
test1()
print("success")
if __name__ == "__main__":
print(f"Running wf() {hello_world_wf()}")
4. We are registering workflows using below commands
- pyflyte --pkgs workflows package --image public.ecr.aws/<application-name>/flyte:latest -f
- git rev-parse HEAD
- flytectl register files --project my-project --domain development --archive flyte-package.tgz --version "${git rev-parse HEAD}"
Is there internal some circular dependency from flyte causing this issue?
I tried the above project in my local setup to test with basic installation. I am getting below error in local setup.
ERROR in local flyte cluster:
[1/1] currentAttempt done. Last Error: USER::Pod failed. No message received from kubernetes.
[f24327f2f9d41438aaef-n0-0] terminated with exit code (128). Reason [StartError]. Message:
failed to create containerd task: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "pyflyte-fast-execute": executable file not found in $PATH: unknown.
Anybody faced this issue before and knows what could be the reason ?strong-plumber-41198
01/29/2024, 4:21 PMpyflyte run
command with poetry. Normally running poetry udpate
resolves the issue.important-grass-6350
01/29/2024, 5:45 PM__init__() got an unexpected keyword argument 'connection'
important-grass-6350
01/30/2024, 2:02 AMtall-lock-23197
executable file not found in $PATH
error you're seeing has to do with your dockerfile. would you mind sharing it?tall-lock-23197
pyflyte-fast-execute
should get automatically installed with flytekit. it seems like the path isn't being set correctly. here's an example dockerfile for your reference: https://github.com/flyteorg/flytesnacks/blob/master/examples/basics/Dockerfiletall-lock-23197
__init__() got an unexpected keyword argument 'connection'
, i'm not sure what connection
is here. could you share the full log?important-grass-6350
01/30/2024, 9:40 PMTraceback (most recent call last):
File "/opt/venv/lib/python3.9/site-packages/flytekit/exceptions/scopes.py", line 219, in user_entry_point
return wrapped(*args, **kwargs)
File "/root/workflows/flytetest.py", line 41, in test1
df = conn.execute(query).as_pandas()
File "/opt/venv/lib/python3.9/site-packages/pyathena/pandas/cursor.py", line 138, in execute
self.result_set = AthenaPandasResultSet(
File "/opt/venv/lib/python3.9/site-packages/pyathena/pandas/result_set.py", line 143, in __init__
df = self._as_pandas()
File "/opt/venv/lib/python3.9/site-packages/pyathena/pandas/result_set.py", line 389, in _as_pandas
df = self._read_csv()
File "/opt/venv/lib/python3.9/site-packages/pyathena/pandas/result_set.py", line 305, in _read_csv
raise OperationalError(*e.args) from e
Message:
__init__() got an unexpected keyword argument 'connection'
User error.
I am also attaching the error logs from the pod for the reference.tall-lock-23197
important-grass-6350
01/31/2024, 3:34 PMtall-lock-23197
important-grass-6350
02/01/2024, 4:21 PMtall-lock-23197
tall-lock-23197
We wanted to understand as pyflyte wraps the image and register it, is it doing anything under the hood for the version which is creating an issue?that shouldn't happen.
important-grass-6350
02/02/2024, 5:56 AMtall-lock-23197
connection
param, it'd make things easier. may be log kwargs? meanwhile, you can also try using the athena integration (backend setup).important-grass-6350
02/04/2024, 2:35 AMimportant-grass-6350
02/04/2024, 2:36 AMtall-lock-23197
tall-lock-23197
important-grass-6350
02/06/2024, 12:21 AMtall-lock-23197
tall-lock-23197
important-grass-6350
02/07/2024, 3:34 PMimportant-grass-6350
02/22/2024, 8:27 PMimportant-grass-6350
03/05/2024, 2:09 PMtall-lock-23197