yocto-gl icon indicating copy to clipboard operation
yocto-gl copied to clipboard

Applymap depreciated, use map

Open cdreetz opened this issue 1 year ago • 11 comments

Issues Policy acknowledgement

  • [X] I have read and agree to submit bug reports in accordance with the issues policy

Where did you encounter this bug?

Local machine

Willingness to contribute

Yes. I can contribute a fix for this bug independently.

MLflow version

  • Client: 2.9.2

System information

  • MacOS
  • 3.10.10

Describe the problem

Just a warning regarding applymap depreciation. I changed the two cases the warning metions to map and the warning goes away.

Tracking information

REPLACE_ME

Code to reproduce issue

import mlflow

results = mlflow.evaluate(
    gpt_model,
    eval_df,  
    model_type="question-answering",
    predictions="response",
    evaluator_config={
        "col_mapping": {
            "system_prompt": "system_prompt",
            "inputs": "questions",  
            "context": "source_documents",  
        }
    },
)```


### Stack trace

<!-- PLEASE KEEP BACKTICKS AND CHECK PREVIEW -->

FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead. string_columns = trimmed_df.columns[(df.applymap(type) == str).all(0)] DataFrame.applymap has been deprecated. Use DataFrame.map instead. data = data.applymap(_hash_array_like_element_as_bytes)



### Other info / logs

<!-- PLEASE KEEP BACKTICKS AND CHECK PREVIEW -->

REPLACE_ME



### What component(s) does this bug affect?

- [ ] `area/artifacts`: Artifact stores and artifact logging
- [ ] `area/build`: Build and test infrastructure for MLflow
- [ ] `area/deployments`: MLflow Deployments client APIs, server, and third-party Deployments integrations
- [ ] `area/docs`: MLflow documentation pages
- [ ] `area/examples`: Example code
- [ ] `area/model-registry`: Model Registry service, APIs, and the fluent client calls for Model Registry
- [ ] `area/models`: MLmodel format, model serialization/deserialization, flavors
- [ ] `area/recipes`: Recipes, Recipe APIs, Recipe configs, Recipe Templates
- [ ] `area/projects`: MLproject format, project running backends
- [ ] `area/scoring`: MLflow Model server, model deployment tools, Spark UDFs
- [ ] `area/server-infra`: MLflow Tracking server backend
- [ ] `area/tracking`: Tracking Service, tracking client APIs, autologging

### What interface(s) does this bug affect?

- [ ] `area/uiux`: Front-end, user experience, plotting, JavaScript, JavaScript dev server
- [ ] `area/docker`: Docker use across MLflow's components, such as MLflow Projects and MLflow Models
- [ ] `area/sqlalchemy`: Use of SQLAlchemy in the Tracking Service or Model Registry
- [ ] `area/windows`: Windows support

### What language(s) does this bug affect?

- [ ] `language/r`: R APIs and clients
- [ ] `language/java`: Java APIs and clients
- [ ] `language/new`: Proposals for new client languages

### What integration(s) does this bug affect?

- [ ] `integrations/azure`: Azure and Azure ML integrations
- [ ] `integrations/sagemaker`: SageMaker integrations
- [ ] `integrations/databricks`: Databricks integrations

cdreetz avatar Dec 17 '23 00:12 cdreetz

Hi @cdreetz, thanks for the report! Do you want to raise a PR for the fix you made?

daniellok-db avatar Dec 18 '23 02:12 daniellok-db

@daniellok-db yeah i'll get that in today

cdreetz avatar Dec 18 '23 18:12 cdreetz

@cdreetz I took a look at the PR, it seems like map was only added in pandas>=2.1—i think it might be best to hold off on this change until pandas is about to remove applymap, otherwise we risk breaking a lot of workflows.

daniellok-db avatar Dec 20 '23 02:12 daniellok-db

@mlflow/mlflow-team Please assign a maintainer and start triaging this issue.

github-actions[bot] avatar Dec 25 '23 00:12 github-actions[bot]

Still occurs this warning now 2024 Feb. How about progress?

newini avatar Feb 07 '24 02:02 newini

Same here

eedahl avatar Mar 12 '24 08:03 eedahl

Hi, is there any updates? Still having this issue

fzyzcjy avatar Mar 17 '24 11:03 fzyzcjy

hello! still having this warning!

maximilianofried avatar Mar 22 '24 12:03 maximilianofried

Hello, i'm using 2.11.3 version and still the warning is there.

yaniela avatar Mar 27 '24 20:03 yaniela

Having the same error

ArslanKAS avatar Apr 12 '24 21:04 ArslanKAS

Try to change this line in digest_utils.py from: df.applymap(str)

to: df.map(str)

it worked for me.

Deltan2002 avatar Apr 13 '24 11:04 Deltan2002