lestrrat-p5 / DateTime-Format-Pg

Other
2 stars 5 forks source link

Should format methods return undef on undef? #16

Closed simongreen-net closed 3 years ago

simongreen-net commented 7 years ago

Hi,

Before I submit a patch, I am wondering if the format_* methods should return undef if undef is the first value? The reason this would be handy is if I am calling D::F::Pg->format_timestamptz(undef), then I would get undef back, which is suitable for a call to DBI's execute (to mean a NULL value).

-- Simon

simongreen-net commented 7 years ago

currently we get 'Can't call method "is_infinite" on an undefined value at /usr/share/perl5/DateTime/Format/Pg.pm line 764.'

lestrrat commented 3 years ago

Sorry to have warnocked this repo for such a long time.

If this module were to be actively maintained, I suppose such a change may be acceptable, but as I don't actively code in Perl, the answer for the time being is probably no. The main reason is that I don't have the time to assess the extent of ripple effects that a change like this may cause. Sure, it may be none, but I wouldn't know until I spend a good amount of time hunting for people/modules using this module.

If there's an active maintainer, they can probably react quickly, but you see what's happening here, so... yeah. I don't want to change a behavior that's been expected for years and then just disappear for another three years.

I'm going to close this issue because it's so old (yes, I know it's my fault). If you are somehow still needing this, please don't hesitate to reopen.