allegroai / clearml

ClearML - Auto-Magical CI/CD to streamline your AI workload. Experiment Management, Data Management, Pipeline, Orchestration, Scheduling & Serving in one MLOps/LLMOps solution
https://clear.ml/docs
Apache License 2.0
5.42k stars 643 forks source link

Fix python-fire integration (issue #/1268) #1275

Closed tvelovraf closed 4 weeks ago

tvelovraf commented 1 month ago

Related Issue \ discussion

Check #1268

Patch Description

ClearML reassignes python-fire function _CallAndUpdateTrace with the _patched_call wrapper call result. The first argument of _patched_call is _CallAndUpdateTrace itself and the second is __CallAndUpdateTrace from ClearML. In the end, original function is passed to the __CallAndUpdateTrace with all its arguments.

Original function sets the default value for target argument as None. So it could be successfully called without passing this argument explicitly (done there). But when it comes to __CallAndUpdateTrace in ClearML - there is no default value for target. So it throws an error of missing positional argument as I mentioned in #1268

Testing Instructions

Code example given in the related issue is enough for testing this behaviour.