Empty object properties

Hi Speckle Team,

I’m sending objects to a Speckle server using Python. Some of my object properties are None (i.e. empty), and are therefore not send to the Speckle server. However, I would like to see them on the Speckle server, but as empty attributes. So the question: What is the recommended way to add empty properties to a Speckle object?

All suggestions are welcome!

I suspect this is something @izzylys can help with. IIRC, we’re not liking nulls that much, but because of popular demand, currently backtracking on this across our sdks. We need to be quite careful in doing so, as a lot of code might break.

An alternative approach would be to not send an object with empty props, but simply the prop names that you need and use that to create the object you want on the receiving end. This can be done nicely in grassopper, but we’d need to know a bit more about your usecase to see if it’s feasible :slight_smile:

1 Like

heya!

yes as dim said, we do not send nulls though this will be changing soon. in the meantime, there isn’t a “recommended” way to do this so you’d want to come up with a convention that works for your situation. for some inspo, the few times I’ve wanted to do this I’ve just used a single space for strings, and -1 or 0 for nums

Cool! Any idea when the option to send Nulls becomes available (rough estimate)? When it’s in the near future I might as well wait for it instead of building logic for it myself.

We’re investigating what it’ll take during this sprint, so hopefully in a few weeks time it’ll be implemented!