Hello folks, I register a flow in this way: ```imp...
# prefect-community
a
Hello folks, I register a flow in this way:
Copy code
import prefect
from prefect import task, Flow

@task
def hello_task():
    logger = prefect.context.get("logger")
    <http://logger.info|logger.info>("Hello, Cloud!")

flow = Flow("hello-flow", tasks=[hello_task])

flow.register(labels=['public'])
But the label of a flow run is:
Copy code
"type": "LocalEnvironment",
  "labels": [
     "public",
     "AppledeMacBook-Pro.local"
  ],
Is there a way to get rid of label “AppledeMacBook-Pro.local” for it impacts the agent to pick up the flow run? thanks
k
Try this:
Copy code
from prefect.environments import LocalEnvironment
flow.environment = LocalEnvironment(labels=["public"])
flow.register()
a
thanks Klemen, it’s the same for LocalEnvironment is the default. I’m thinking of custom environemnt
k
Hm… what if you register your flow with CLI:
Copy code
prefect auth login -t $prefect_user_token
prefect register flow -f $FLOW
a
Looked at the code and figured out a way:
Copy code
flow.register(add_default_labels=False)
👍 1
Thanks for your help