In Twitter API (https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/tweet-object), some of the fields are Int and some others Integer which are Nullable. For instance retweet_count
is Int, but favourite_count
is Integer (which is Nullable). What does it mean for favourite_count
to be Nullable? and why favourite_count
can be Nullable but retweet_count
cannot?
I asked a similar question a few years back on the Twitter forum.
For scalability, the Twitter API has eventual consistency. The effect is that sometimes you won't receive all of the data or the data hasn't been updated.
Because of this, some fields are marked as nullable
to indicate that there may or may not be data for that field, but we don't know at the time of the query.