Azure / Azure/Webjobs.Extensions.Kusto

problems converting Kusto Boolean data types.

Open
#46 0 comments 0 reactions 1 assignee Claimed by @ag-ramachandran View on GitHub
Dominant language
C#
Stars
5
Forks
15
PR merge metrics
No merged PRs in 30d

Description

problems converting Kusto Boolean data types.

Given this table structure, where the property IsHealthy is of type bool:

![image](https://github.com/Azure/Webjobs.Extensions.Kusto/assets/106139410/f1bdfcd1-4513-48e2-946a-f254e1a2305f)

If I create an input binding with casting to my typed class:

![image](https://github.com/Azure/Webjobs.Extensions.Kusto/assets/106139410/90f9f658-dc5b-46fc-9b14-6229bbddd4ec)

With the Heartbeat record being:

I get this Exception:

![image](https://github.com/Azure/Webjobs.Extensions.Kusto/assets/106139410/9255836e-07b4-420b-906d-db66a5e60e51)

As it turns out, the input binding cast logic seems to convert a boolean in to a Number:

![image](https://github.com/Azure/Webjobs.Extensions.Kusto/assets/106139410/c29da71a-8bee-4d2e-bd39-17bd42a179f1)

(If I temporarily let it convert to an Enumerable of Objects instead):


![image](https://github.com/Azure/Webjobs.Extensions.Kusto/assets/106139410/8a9910bb-4729-4a8a-b88b-e8dc99ba78e6)

That would explain the above Exception.

Now, my workaround is to assign a Custom Converter to that Boolean property:

Then it seems to work fine.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.