Tim A
06/14/2023, 7:58 PMJeff Hale
06/14/2023, 8:00 PMCody
06/14/2023, 8:01 PMJeff Hale
06/14/2023, 8:02 PM.
right?Cody
06/14/2023, 8:04 PMprefect deploy 104\flow.py:pipe
and
prefect deploy .\104\flow.py:pipe
threw that errorJeff Hale
06/14/2023, 8:04 PMCody
06/14/2023, 8:04 PMimport httpx
from prefect import flow, task
@task
def fetch_cat_fact():
return httpx.get("<https://catfact.ninja/fact?max_length=140>").json()["fact"]
@task(persist_result=True)
def formatting(fact: str):
return fact.title()
@flow
def pipe():
fact = fetch_cat_fact()
formatted_fact = formatting(fact)
if __name__ == "__main__":
pipe()
Jeff Hale
06/14/2023, 8:05 PMCody
06/14/2023, 8:05 PMJeff Hale
06/14/2023, 8:06 PMCody
06/14/2023, 8:06 PM❯❯❯ prefect deploy 104\flow.py:pipe
Traceback (most recent call last):
File "C:\Users\Cody\anaconda3\envs\pcc310\lib\site-packages\prefect\cli\_utilities.py", line 41, in wrapper
return fn(*args, **kwargs)
File "C:\Users\Cody\anaconda3\envs\pcc310\lib\site-packages\prefect\utilities\asyncutils.py", line 255, in coroutine_wrapper
return call()
File "C:\Users\Cody\anaconda3\envs\pcc310\lib\site-packages\prefect\_internal\concurrency\calls.py", line 383, in __call__
return self.result()
File "C:\Users\Cody\anaconda3\envs\pcc310\lib\site-packages\prefect\_internal\concurrency\calls.py", line 283, in result
return self.future.result(timeout=timeout)
File "C:\Users\Cody\anaconda3\envs\pcc310\lib\site-packages\prefect\_internal\concurrency\calls.py", line 169, in result
return self.__get_result()
File "C:\Users\Cody\anaconda3\envs\pcc310\lib\concurrent\futures\_base.py", line 403, in __get_result
raise self._exception
File "C:\Users\Cody\anaconda3\envs\pcc310\lib\site-packages\prefect\_internal\concurrency\calls.py", line 346, in _run_async
result = await coro
File "C:\Users\Cody\anaconda3\envs\pcc310\lib\site-packages\prefect\cli\deploy.py", line 300, in deploy
await _run_single_deploy(
File "C:\Users\Cody\anaconda3\envs\pcc310\lib\site-packages\prefect\client\utilities.py", line 40, in with_injected_client
return await fn(*args, **kwargs)
File "C:\Users\Cody\anaconda3\envs\pcc310\lib\site-packages\prefect\cli\deploy.py", line 391, in _run_single_deploy
flow_name = flow.name
AttributeError: 'NoneType' object has no attribute 'name'
An exception occurred.
Jeff Hale
06/14/2023, 8:06 PMJeff Hale
06/14/2023, 8:06 PMJeff Hale
06/14/2023, 8:07 PMCody
06/14/2023, 8:07 PMCody
06/14/2023, 8:07 PMTim A
06/14/2023, 8:07 PMTim A
06/14/2023, 8:08 PMJeff Hale
06/14/2023, 8:08 PMJeff Hale
06/14/2023, 8:08 PMTim A
06/14/2023, 8:09 PME:\prefect-training (main -> origin)
(prefect) λ prefect deploy weather.py:aggregate_temps
Tim A
06/14/2023, 8:09 PMTim A
06/14/2023, 8:10 PMJeff Hale
06/14/2023, 8:11 PMprefect deploy
cli command might be altering the path. But you tried it in the same directory, so maybe that’s not it.Tim A
06/14/2023, 8:12 PMTim A
06/14/2023, 8:13 PMTim A
06/14/2023, 8:13 PMfrom prefect.cli.deploy import deploy
deploy(
entrypoint='E:\\prefect-training\\weather.py',
flow_name='randomize',
names=['this-is-a-test',]
)
Cody
06/14/2023, 8:20 PMJeff Hale
06/14/2023, 8:22 PMTim A
06/14/2023, 8:24 PMTim A
06/14/2023, 8:31 PMtim@PRO237:/mnt/e/prefect-training$ /home/tim/.local/bin/prefect deploy weather.py:randomize
Traceback (most recent call last):
File "/home/tim/.local/lib/python3.10/site-packages/prefect/cli/_utilities.py", line 41, in wrapper
return fn(*args, **kwargs)
File "/home/tim/.local/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 255, in coroutine_wrapper
return call()
File "/home/tim/.local/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 383, in __call__
return self.result()
File "/home/tim/.local/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 283, in result
return self.future.result(timeout=timeout)
File "/home/tim/.local/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 169, in result
return self.__get_result()
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/home/tim/.local/lib/python3.10/site-packages/prefect/_internal/concurrency/calls.py", line 346, in _run_async
result = await coro
File "/home/tim/.local/lib/python3.10/site-packages/prefect/cli/deploy.py", line 300, in deploy
await _run_single_deploy(
File "/home/tim/.local/lib/python3.10/site-packages/prefect/client/utilities.py", line 40, in with_injected_client
return await fn(*args, **kwargs)
File "/home/tim/.local/lib/python3.10/site-packages/prefect/cli/deploy.py", line 391, in _run_single_deploy
flow_name = flow.name
AttributeError: 'NoneType' object has no attribute 'name'
An exception occurred.
tim@PRO237:/mnt/e/prefect-training$
Jeff Hale
06/14/2023, 8:32 PMCody
06/14/2023, 8:32 PMDirectory: C:\wageup\pcc\prefect_lab\104
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 6/14/2023 14:29 __pycache__
-a---- 6/14/2023 13:42 381 flow.py
-a---- 6/14/2023 13:29 0 __init__.py
Cody C:/wageup/pcc/prefect_lab/104 ﲍ pcc 14:31:07
❯❯❯ prefect deploy flow.py:pipe
Traceback (most recent call last):
Tim A
06/14/2023, 8:43 PME:\prefect-training (main -> origin)
(prefect) λ prefect deployment apply deployment.yaml
'deployment.yaml' did not conform to deployment spec: AttributeError("'NoneType' object
has no attribute 'name'")
Jeff Hale
06/14/2023, 8:52 PMprefect apply
Jeff Hale
06/14/2023, 8:54 PMprefect deploy path_to_flow:flow_function -n my_deployment_name
Tim A
06/14/2023, 9:03 PMJeff Hale
06/14/2023, 9:08 PMprefect deployment apply
isn’t in that tutorial - maybe from somewhere else.Cody
06/27/2023, 8:15 PMCody
06/27/2023, 8:26 PM