Tim Helfensdörfer
07/08/2022, 6:30 PMFile "/Users/****/Library/Caches/pypoetry/virtualenvs/equation-kGZ4A1K9-py3.8/lib/python3.8/site-packages/prefect/cli/cloud.py", line 231, in login
exit_with_success(
File "/Users/****/Library/Caches/pypoetry/virtualenvs/equation-kGZ4A1K9-py3.8/lib/python3.8/site-packages/prefect/cli/_utilities.py", line 36, in exit_with_success
app.console.print(message, **kwargs)
AttributeError: 'PrefectTyper' object has no attribute 'console'
When trying to run (which worked in 2b7:
await login(
key=os.environ.get("PREFECT_API_KEY"),
workspace_handle=os.environ.get("PREFECT_WORKSPACE_HANDLE"),
)
await login
method with the following:
key = os.environ.get("PREFECT_API_KEY")
workspace_handle = os.environ.get("PREFECT_WORKSPACE_HANDLE")
async with get_cloud_client(api_key=key) as client:
try:
workspaces = await client.read_workspaces()
except CloudUnauthorizedError:
logger.error(
"Unable to authenticate. Please ensure your credentials are correct."
)
return ""
workspaces = {
f"{workspace['account_handle']}/{workspace['workspace_handle']}": workspace
for workspace in workspaces
}
update_current_profile(
{
PREFECT_API_URL: build_url_from_workspace(workspaces[workspace_handle]),
PREFECT_API_KEY: key,
}
)
Kevin Kho
07/08/2022, 6:42 PMTim Helfensdörfer
07/08/2022, 6:45 PMZanie
07/08/2022, 6:45 PMTim Helfensdörfer
07/08/2022, 6:46 PM