Hello every one! Can you modify a [mapped] task na...
# prefect-community
m
Hello every one! Can you modify a [mapped] task name on runtime? I am doing a project where i do web-scraping to retrieve data for each institution (hospital) on a web site. instead of
[2020-07-30 16:24:11] INFO - prefect.TaskRunner | Task 'Scraping Institution Data[0]': Starting task run...
I would like to have
[2020-07-30 16:24:11] INFO - prefect.TaskRunner | Task 'Scraping Institution Data[0] [hospital name]': Starting task run...
I think this would be great when you visualize the flow run in the UI to know by the task name for which hospital the web scrapping Failed. Whithout going the the logs P.S Currently i am logging the Hospital name to know What hospital data is currently web-scraped
Copy code
@task(name="Scraping Institution Data")
def scrape_institution_data(instActionIdTuple):
    logger = prefect.context.get("logger")
    <http://logger.info|logger.info>(f"Scraping for site: {instActionIdTuple[0]}")
So at runtime i get:
[2020-07-30 16:24:11] INFO - prefect.TaskRunner | Task 'Scraping Institution Data[0]': Starting task run...
[2020-07-30 16:24:11] INFO - prefect.Scraping Institution Data[0] | Scraping for site: Hôspital Claire Heureuse de Marchand Dessalines
👀 1
i
@Mac Gréco Péralte Chéry Something like this? https://github.com/PrefectHQ/prefect/issues/2100
✔️ 1
d
Hi @Mac Gréco Péralte Chéry, Itay nailed it with the link above! We’re aware of the use case and we’ll circle back on that issue when it gets worked on 👍
❤️ 1
m
Absolutely! happy to see this is a requested functionality.
🙌 1