Skip to content

Review code in Oracle strftime #1808

Description

@nj1973

The code below from Oracle _reduce_tokens() appears to be incorrect. %e is to format day of the month padded with a leading space.

            elif token == "%e":
                # pad with spaces instead of zeros
                value = sa.func.replace(sa.func.to_char(arg, "DD"), "0", " ")

The Oracle code was introduced during the upgrade to ibis 5.1.0. The developer wanted to replace occurrences of '05', '06' in month number as ' 5' and ' 6'. It is not clear if string needs to have a space. If not, the developer could use the format specified 'FMDD' which will not produce '05' and '06', instead '5' and '6'. As the code is currently written, it would appear that day 10 will appear as 1 and likely show as not matching. This needs to be verified and if true an issue needs to be opened.

I suspect it's never mattered because DVT doesn't use the %e format. Still - we should look into it.

The same concern can be found in Db2 _reduce_tokens().

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions