This change updates the `TZDateTime` type decorator to use the timezone awareness checks described in the Python documentation located here:
https://docs.python.org/3/library/datetime.html#determining-if-an-object-is-aware-or-naive
The specific lines state:
> A `datetime` object `d` is aware if both of the following hold:
>
>```python
d.tzinfo is not None
d.tzinfo.utcoffset(d) does not return None
```
>
>Otherwise, `d` is naive.
def process_bind_param(self, value, dialect):
if value is not None:
- if not value.tzinfo:
+ if not value.tzinfo and not value.tzinfo.utcoffset(value):
raise TypeError("tzinfo is required")
value = value.astimezone(datetime.timezone.utc).replace(tzinfo=None)
return value