Skip to main content

175 posts tagged with "Python"

Python Programming Language

View All Tags

Fixed: "TypeError: got an unexpected keyword argument 'squared'" in scikit-learn mean_squared_error

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

mean_squared_error(y_true, y_pred, squared=False) is how many tutorials calculate RMSE. In scikit-learn 1.9.1 it fails with TypeError: got an unexpected keyword argument 'squared': the argument was deprecated in scikit-learn 1.4 and has since been removed. root_mean_squared_error() does the same calculation.

Fixed: "MlflowException: API request to … failed with exception … Max retries exceeded" Connection Refused in MLflow

· 9 min read
Jagdish Kumawat
Founder @ Dewiride

An MLflow training run printed seven urllib3 retry warnings over about four minutes, then failed with MlflowException: API request to … failed with exception … Max retries exceeded … [Errno 61] Connection refused. Nothing was listening at the tracking URI. MLflow's client retries for minutes before it gives up, which makes a missing server look like a hang. Starting the server fixed it, and MLFLOW_HTTP_REQUEST_MAX_RETRIES makes the same mistake fail in seconds.

Fixed: SADeprecationWarning "The noload loader strategy is deprecated" When You Run pytest with MLflow

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

pytest passed all 12 tests of a project that logs to MLflow, then printed a warnings summary: SADeprecationWarning: The ``noload`` loader strategy is deprecated. It comes from MLflow 3.18.0's SQL tracking store meeting SQLAlchemy 2.1, and MLflow fixed it the day after 3.18.0 shipped. Until a release includes the fix, one filterwarnings line hides exactly this warning in your tests.

Fixed: "Exception ignored on threading shutdown" KeyboardInterrupt When You Stop the MLflow Server

· 9 min read
Jagdish Kumawat
Founder @ Dewiride

Pressing Ctrl+C to stop MLflow 3.18.0's tracking server printed Exception ignored on threading shutdown: and a KeyboardInterrupt traceback from Python's own threading.py. Nothing crashed: the server stopped cleanly, and the message comes from its background job runner being interrupted at exit. If you don't use MLflow's server jobs, MLFLOW_SERVER_ENABLE_JOB_EXECUTION=false makes it go away.

Fixed: "StarletteDeprecationWarning: starlette.middleware.wsgi is deprecated" When You Start the MLflow Server

· 8 min read
Jagdish Kumawat
Founder @ Dewiride

Starting MLflow 3.18.0's tracking server printed StarletteDeprecationWarning: starlette.middleware.wsgi is deprecated four times. Nothing was wrong with my setup: the warning comes from MLflow's own code meeting Starlette 1.10.0, and the server works. One PYTHONWARNINGS filter hides this warning, and only this one, until MLflow changes its code.

Fixed: "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate" in Python on macOS

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

A Python script on my Mac couldn't open an HTTPS address: ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate. curl opened the same address without a problem. Python from python.org brings its own OpenSSL, which doesn't use the Mac's certificates, and the fix is a script that comes with it: Install Certificates.

Build an AI Lead Qualification Agent with Claude and Python — Part 7: Test the Lead Qualifier with pytest

· 29 min read
Jagdish Kumawat
Founder @ Dewiride

The last part turns the Lead Qualifier into something you can change without fear. You test the whole API, every failure from Part 6 included, with a fake that stands in for Claude, so the tests run in a fraction of a second and never cost a cent. Then you add a quality gate and a README, release version 1.0.0, and look back at everything you built.

Build an AI Lead Qualification Agent with Claude and Python — Part 6: Handle Errors and Log Safely

· 29 min read
Jagdish Kumawat
Founder @ Dewiride

Every service that depends on another service will one day see it fail. In this part the Lead Qualifier learns to fail well. Every problem with Claude becomes a clear HTTP response the caller can act on, slow requests stop at a timeout, and every lead writes one log line with its cost. That line says nothing about the customer.

Build an AI Lead Qualification Agent with Claude and Python — Part 5: Score and Prioritize Leads You Can Explain

· 23 min read
Jagdish Kumawat
Founder @ Dewiride

Claude now reports the facts about every inquiry. In this part your own code turns those facts into a decision: a lead score from 0 to 100, a priority, and the reason behind every single point. The rules fit on one screen, a salesperson can read them, and a tricky sender cannot talk their way to the top of the list.