https://prefect.io logo
j

Justin Malcolm

07/12/2023, 5:43 PM
Feedback - prefect version 2.10.20/python 3.11.4 Hi, apologies if this isn't the right place but i couldn't find a feedback channel. I'm noticing that URL's printed to terminal have artificial line breaks which breaks the ability to click the links. For example, when creating a deployment or registering some blocks, this is what it's showing. When you follow the link it loads a broken page. I've tested against other terminal windows and also resizing windows but same issue. Long URLs break correctly for other tools i use.
j

jpuris

07/12/2023, 6:49 PM
Are you sure this is not simply your window doing soft wrapping? There are no newlines in the URL in the prefect cli code.. https://github.com/PrefectHQ/prefect/blob/79e2bd6159106d2e23711b41c6fea88626c5f9ca/src/prefect/cli/deploy.py#L581
What terminal app are you using? Is this
<http://iTerm2.app|iTerm2.app>
by any chance?
1
j

Justin Malcolm

07/12/2023, 6:51 PM
Thanks for the link! yea it's odd, no soft wrap and other tools work just fine. I'll dig in more to see if something else has changed with an OS or software update. Thanks for the response
j

jpuris

07/12/2023, 6:54 PM
Yea, I can reproduce this in
<http://iTerm2.app|iTerm2.app>
and
<http://VSCode.app|VSCode.app> (terminal)
Looks like a common issue with terminals :s here is issue for VSCode https://github.com/microsoft/vscode/issues/28746
j

Justin Malcolm

07/12/2023, 6:55 PM
interesting, and it's not every URL which is what made me suspect, look at this and it works fine:
j

jpuris

07/12/2023, 6:58 PM
Here is the code for the
deployment run
print https://github.com/PrefectHQ/prefect/blob/79e2bd6159106d2e23711b41c6fea88626c5f9ca/src/prefect/cli/deployment.py#L623 Looks sort of normal.. it does seem odd that it works one way and not the other
👍 1
j

Justin Malcolm

07/12/2023, 7:00 PM
thanks for looking at this though, it is very odd depending on the format of the output. Oh well, thanks for the links and info. I primarily use vscode so i'll follow that issue linked above
j

jpuris

07/12/2023, 7:14 PM
I can not reproduce this with simple print in python. I'm thinking this is something Prefect's
RichTextIO
class adds to the output that breaks the terminal in detecting urls properly 🤷
I managed to reproduce this with https://rich.readthedocs.io/en/stable/markup.html#console-markup Prefect logger uses this to make the log output fancy i.e. colours and what not..
Copy code
mkdir -p tmp/prefect_rich_experiment && $_

python3 -m venv venv && source venv/bin/activate

pip install prefect

python
this works fine
Copy code
PREFECT_UI_URL = "<https://app.prefect.cloud/account/7faa0570-20e6-11ee-be56-0242ac120002/workspace/7faa0570-20e6-11ee-be56-0242ac120002>"
deployment_id = "7faa0570-20e6-11ee-be56-0242ac120002"

print(
    "View Deployment in UI:"
    f" {PREFECT_UI_URL}/deployments/deployment/{deployment_id}"
)
this does not..
Copy code
from rich import print


PREFECT_UI_URL = "<https://app.prefect.cloud/account/7faa0570-20e6-11ee-be56-0242ac120002/workspace/7faa0570-20e6-11ee-be56-0242ac120002>"
deployment_id = "7faa0570-20e6-11ee-be56-0242ac120002"

print(
    "View Deployment in UI:"
    f" {PREFECT_UI_URL}/deployments/deployment/{deployment_id}"
)
fair to say this is a problem with upstream dep 😕
🙌 1
j

Justin Malcolm

07/12/2023, 7:23 PM
Ok thanks!