Hi Team, We are getting the below error when we are using pandascursor to get the Athena query resul...
j

Jayanth S N

over 1 year ago
Hi Team, We are getting the below error when we are using pandascursor to get the Athena query result in the flyte workflow, which is only occurring when we use PyAthena >3.0.10. However below python code works fine with other application but doesn't work inside flyte. ERROR in Organization Cluster:
__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 ?
I need some help getting launchplans with a cronjob configured to work: I first register a launchpl...
f

Fabio Grätz

over 3 years ago
I need some help getting launchplans with a cronjob configured to work: I first register a launchplan with a
* * * * *
cron expression via flyteremote. After that, the flyte UI still shows
This workflow has no schedules
, as expected. I then execute
flytectl update launchplan -p default -d development --version fabio-cron-2a3fb7f-dirty-BQN44 cron_hydra_workflow_cfg_flyte_workflows.collaborative_filtering.workflow_0 --activate
which gives:
updated launchplan successfully on cron_hydra_workflow_cfg_flyte_workflows.collaborative_filtering.workflow_0%
In the UI, the schedule is updated as well, it now says
Every minute
. Problem: I’m not seeing any executions. The flyte admin shows this in the logs after I activated the launchplan:
{"json":{"src":"launch_plan.go:108"},"level":"info","msg":"Adding resource type for unspecified value in request: [%+v]id:\u003cproject:\"default\" domain:\"development\" name:\"cron_hydra_workflow_cfg_flyte_workflows.collaborative_filtering.workflow_0\" version:\"fabio-cron-2a3fb7f-dirty-BQN44\" \u003e state:ACTIVE ","ts":"2022-03-31T18:13:01Z"}
{"json":{"src":"log.go:42"},"level":"warning","msg":"Failed to parse authenticated client metadata when creating audit log","ts":"2022-03-31T18:13:01Z"}
{"json":{"src":"log.go:91"},"level":"info","msg":"Recording request: [{\"Principal\":{\"Subject\":\"\",\"ClientID\":\"\",\"TokenIssuedAt\":\"0001-01-01T00:00:00Z\"},\"Client\":{\"ClientIP\":\"\"},\"Request\":{\"Method\":\"UpdateLaunchPlan\",\"Parameters\":{\"domain\":\"development\",\"name\":\"cron_hydra_workflow_cfg_flyte_workflows.collaborative_filtering.workflow_0\",\"project\":\"default\",\"version\":\"fabio-cron-2a3fb7f-dirty-BQN44\"},\"Mode\":1,\"ReceivedAt\":\"2022-03-31T18:13:01.578706629Z\"},\"Response\":{\"ResponseCode\":\"OK\",\"SentAt\":\"2022-03-31T18:13:01.597983728Z\"}}]","ts":"2022-03-31T18:13:01Z"}
The
flytescheduler
doesn’t show any update in the logs. Does anyone have some guidance where to start debugging this? Thanks!