Skip to content

Replace deprecated usages of util.isDate & util.isString #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ramikg
Copy link
Contributor

@ramikg ramikg commented Nov 3, 2024

The functions util.isDate & util.isString have been deprecated for a few years, and have been removed in Node.js 23.

In order for nodejs-driver to be supported on recent Node.js versions, I've replaced their usages with the ones recommended in the docs.

@ruben-chavarria
Copy link

Yep, I'm having the same issue on Node.js v22

(node:66) [DEP0047] DeprecationWarning: The `util.isDate` API is deprecated.  Please use `arg instanceof Date` instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

Using flag --trace-deprecation:

(node:17) [DEP0047] DeprecationWarning: The `util.isDate` API is deprecated.  Please use `arg instanceof Date` instead.
    at /app/node_modules/cassandra-driver/lib/utils.js:216:14
    at Array.forEach (<anonymous>)
    at Object.deepExtend (/app/node_modules/cassandra-driver/lib/utils.js:200:11)
    at Object.extend (/app/node_modules/cassandra-driver/lib/client-options.js:116:25)
    at new Client (/app/node_modules/cassandra-driver/lib/client.js:402:32)
...

This PR seems to be a good fix for the deprecation warning 👍

@ramikg
Copy link
Contributor Author

ramikg commented Dec 3, 2024

This PR seems to be a good fix for the deprecation warning 👍

Thank you. Unfortunately, I'm not sure that this repository is being maintained.

@SiyaoIsTraveling
Copy link

SiyaoIsTraveling commented Dec 17, 2024

Hi @ramikg, thank you for your contributions to this project! Yes this project is being maintained :)
I've created a ticket for this PR: NODEJS-682. Both this PR and your PR to remove @types/long dependency look good to me and I would love them to get merged.
Have you signed the Contributor License Agreement for contributions to DataStax open source projects? If not you can find it at https://cla.datastax.com/. Thanks!

@ramikg
Copy link
Contributor Author

ramikg commented Dec 17, 2024

Glad to hear that. Also, I signed the CLA.

Copy link

@SiyaoIsTraveling SiyaoIsTraveling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM! util.isDate and util.isString are deprecated and this PR replaced them by the practices suggested by the official doc. Please merge as long as it passes all the tests @absurdfarce .

@absurdfarce
Copy link
Collaborator

Looks good to me as well; thanks for the PR @ramikg! Agreed that this seems quite sensible.

I've kicked off a Jenkins run for this change, so as long as we don't have any giant regressions or anything we should be fine to get this merged.

@absurdfarce
Copy link
Collaborator

Jenkins run was indeed green, calling this good

@absurdfarce absurdfarce merged commit 804e0bb into datastax:master Dec 24, 2024
3 checks passed
@ramikg
Copy link
Contributor Author

ramikg commented Dec 24, 2024

Thank you!

@ramikg ramikg deleted the bugfix/replace-deprecated-functions branch December 24, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants