Backport TypeCodec parse and format fixes from 3.0

Description

Handle null arguments, remove quotes when needed.

For example, the following fails on 2.1:

DataType.timestamp().parse() should handle quoted timestamps.

Note: this was fixed in 3.0.

Environment

None

Pull Requests

None

Status

Assignee

Olivier Michallat

Reporter

Olivier Michallat

Labels

None

PM Priority

None

Reproduced in

None

Affects versions

None

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Priority

Minor
Configure