0

I want to pylint app.py which is in the following github repository :

https://github.com/rajas2716/Udacity_MachineLearning_Project.git

But it gives the following messages

app.py:16:4: W1202: Use % formatting in logging functions and pass the % parameters as arguments (logging-format-interpolation)
app.py:58:4: W1202: Use % formatting in logging functions and pass the % parameters as arguments (logging-format-interpolation)
app.py:60:4: W1202: Use % formatting in logging functions and pass the % parameters as arguments (logging-format-interpolation)

I searched the net and found this

https://stackoverflow.com/questions/34619790/pylint-message-logging-format-interpolation#:~:text=Use%20%25%20formatting%20in%20logging%20functions,passing%20the%20parameters%20as%20arguments

So , I changed this

LOG.info(f"Scaling Payload: \n{payload}")

to this

LOG.info(f"Scaling Payload: \n %s",payload)

But still the pylint shows the same message as above

I am naive. Please tell me what to do

1 Answers1

0

You missed to remove f in your last example:

So , I changed this

LOG.info(f"Scaling Payload: \n{payload}")

to this

LOG.info(f"Scaling Payload: \n %s",payload) 

But still the pylint shows the same message as above

Solution:

LOG.info("Scaling Payload: \n %s", payload) 

You should remove f and it will pass the check.

Tested. Lint passed for me on pylint 2.6.0 version.

gore
  • 551
  • 2
  • 20