Simon Bull
02/28/2026, 4:20 AMconverters for read_excel
E.g.:
dataset:
type: pandas.ExcelDataset
filepath: file.xlsx
load_args:
converters:
col: str
dtype_backend: pyarrow
I have a column that contains mixed types. If I do not specify the converter, then pyarrow accept the df at all.
But, specify dataset in catalog as above results in passing the string "str" to read_excel instead of the func str.
Is there any way around this?Simon Bull
02/28/2026, 4:24 AMpd.read_excel(
"file.xlsx",
converters={"Col": str},
dtype_backend="pyarrow",
)
This raises an exception [i.e. i need the converter]:
pd.read_excel(
"file.xlsx",
dtype_backend="pyarrow",
)
And this is equivalent to what kedro does; also raises exception:
pd.read_excel(
"file.xlsx",
converters={"Col": "str"},
dtype_backend="pyarrow",
)datajoely
02/28/2026, 12:15 PMSimon Bull
02/28/2026, 3:39 PM"custom_resolvers": {
"builtins": lambda name: getattr(builtins, name),
},datajoely
02/28/2026, 6:32 PMSimon Bull
02/28/2026, 6:59 PMLaurens Vijnck
03/02/2026, 9:44 AMLaurens Vijnck
03/02/2026, 9:49 AMNok Lam Chan
03/02/2026, 10:12 AMI would love to have a more formal dependency injection system in Kedro thoughWhat is missing?
Laurens Vijnck
03/02/2026, 9:15 PM# params
dataset_search_experiment:
# Experiments to run, each experiment should at least define a `task_fn` that is
# a valid LangFuse task function. Additional entries are passed as kwargs to the task function.
# <https://langfuse.com/docs/evaluation/experiments/experiments-via-sdk#usage-with-langfuse-datasets>
experiments:
- name: exp-gpt-5-mini
model: openai:gpt-5-mini-2025-08-07
prompt_version: 1
task_fn:
_object: pipelines.dataset_search.pipeline.generate_dataset_search_taskLaurens Vijnck
03/02/2026, 9:15 PM# nodes.py
# essentially inject object scans inputs for _object keyword and instantiates the object/fn
@inject_object()
def run_experiments(experiments):
# thanks to decorator, the task_fn is now properly loaded as function
experiments[0].task_fn()Laurens Vijnck
03/02/2026, 9:17 PMNok Lam Chan
03/02/2026, 10:26 PMtask_fn: ${di:pipelines.dataset_search.pipeline.generate_dataset_search_task}
This is essentially the same as having a resolver like this?
def di(dependency):
return importlib.import_module(dependency)Laurens Vijnck
03/03/2026, 8:20 AMNok Lam Chan
03/03/2026, 9:53 AMLaurens Vijnck
03/03/2026, 2:14 PMmodel_tuning_args:
tuner:
_object: matrix.pipelines.modelling.tuning.GaussianSearch
estimator:
_object: lightgbm.LGBMClassifier
n_jobs: 16
random_state: ${globals:random_state}
device: cuda
# objective: binary Confirm with chunyu if this is needed as we are doing multiclass.
boosting_type: gbdt
force_row_wise: true
# Built-in early stopping (works without fit_params)
early_stopping_round: 50
n_calls: 20
splitter:
_object: sklearn.model_selection.StratifiedKFold
n_splits: 2
random_state: ${globals:random_state}
shuffle: True
features: # Features use regex, source_0, source_1, .., target_0, target_1
- source_\d+
- target_\d+
target_col_name: yLaurens Vijnck
03/03/2026, 2:54 PMNok Lam Chan
03/03/2026, 3:11 PMGaussianSearch(estimator, n_calls, splitter) ?Laurens Vijnck
03/03/2026, 3:17 PM_object kw is found, the object with the path is instantiated, with construction args as the other kvs in the yaml dictNok Lam Chan
03/03/2026, 3:22 PMdef run_experiments(experiments, model_tuning_args): # This is still "pure" config
# This is equivalent to the _object instantiate bit
experiments = resolve_objects(experiments)
model_tuning_args = resolve_objects(model_tuning_args)
...Nok Lam Chan
03/03/2026, 3:23 PM_target instead)
https://hydra.cc/docs/advanced/instantiate_objects/overview/Nok Lam Chan
03/03/2026, 3:26 PM@hook_impl
def before_node_run(xxx):
# Iterate config and auto instantiate
Though I think the decorator approach is better in a way that at least this is more transparent.Laurens Vijnck
03/06/2026, 7:16 AMLaurens Vijnck
03/06/2026, 7:16 AM