File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -369,9 +369,12 @@ printfn "%s (retweeted %d times)\n:%s" tweet.User.Value.Name tweet.RetweetCount.
369369
370370(**
371371After creating the ` Tweet ` type, we parse a single sample tweet and print some details about the
372- tweet. As you can see, the ` tweet.User ` property has been inferred as optional (meaning that a
373- tweet might not have an author?) so we unsafely get the value using the ` Value ` property.
374- The ` RetweetCount ` and ` Text ` properties may be also missing, so we also access them unsafely.
372+ tweet. As you can see, the ` tweet.User ` property has been inferred as optional, and so are
373+ ` RetweetCount ` and ` Text ` . The reason is that ` TwitterStream.json ` contains not only tweet objects
374+ but also other event types (such as ` delete ` events) with a completely different schema. When the
375+ type provider merges multiple heterogeneous sample objects, any field that does not appear in all
376+ samples is inferred as optional. We unsafely get the values using the ` Value ` property since we
377+ know our input is a tweet.
375378
376379## Getting and creating GitHub issues
377380
You can’t perform that action at this time.
0 commit comments