brendanhay / gogol

A comprehensive Google Services SDK for Haskell.
Other
281 stars 105 forks source link

[gogol-bigquery] parameter 'requirePartitionFilter' needs to be Optional #122

Closed korayal closed 5 years ago

korayal commented 5 years ago

In the latest version, there is a stray default for the requirePartitionFilter, even though there is a default value ( False ) creation of a table fails if the target is not a partitioned table.

I also think this is a common issue, and we won't be able to pinpoint each similar error until we come across during use. This probably requires a more generic solution like setting a field to Maybe if the field's description contains the keyword [Optional].

MichaelXavier commented 5 years ago

@brendanhay heads up on this: this fixes some breakage on bigquery for folks upgrading to 0.4.0. From what I understand, if you're creating bigquery tables with partitioning disabled, you need to be able to set this new field to Nothing or operations against the table will fail. They failed to mark this field as optional, so the values in our generated haskell can only be True/False, hence the breakage.

This is a breaking field type change (though one that people won't hit if they're just using the default) so if we're following PVP, this would require a 0.5.0 release. Folks using bigquery tables without partitioning basically need to stick to 0.3.0 or add the project as a git dependency. I'll leave it up to you to decide if this warrants an immediate release, or if we're not doing PVP, a minor release of just gogol-bigquery, or if we want to wait for more changes to accumulate before doing 0.5.0.