Skip to content

Comments

[BUGFIX] Fix NameError when requiring the Client class#59

Merged
sergio-bobillier merged 1 commit intomasterfrom
sb-fix-client-standalone-require
Feb 19, 2026
Merged

[BUGFIX] Fix NameError when requiring the Client class#59
sergio-bobillier merged 1 commit intomasterfrom
sb-fix-client-standalone-require

Conversation

@sergio-bobillier
Copy link
Collaborator

@sergio-bobillier sergio-bobillier commented Feb 18, 2026

Fixes a NameError that occurred when requiring 'jay_api/elasticsearch/client' without requiring 'elasticsearch'. The error was happening because of two things:

  1. The class's file was requiring 'elasticsearch/api/namespace/tasks', however, this file was not only not needed by the class but it cannot be directly required, because it tries to use Elasticsearch's Common::Client class without requiring it first, hence the NameError.

  2. Requiring 'elasticsearch/transport/transport/errors', which is actually needed by the class, causes a NameError because it tries to use Timeout::Error without requiring 'timeout' first. So, to fix the issue a require statement for 'timeout' is being added.

This error was only happening when the class was required directly, so it is mostly visible in unit tests.

Fixes a NameError that occurred when requiring
'jay_api/elasticsearch/client' without requiring 'elasticsearch'. The
error was happening because of two things:

1. The class's file was requiring 'elasticsearch/api/namespace/tasks',
   however, this file was not only not needed by the class but it cannot
   be directly required, because it tries to use Elasticsearch's
   Common::Client class without requiring it first, hence the NameError.

2. Requiring 'elasticsearch/transport/transport/errors', which is
   actually needed by the class, causes a NameError because it tries to
   use Timeout::Error without requiring 'timeout' first. So, to fix the
   issue a require statement for 'timeout' is being added.

This error was only happening when the class was required directly, so
it is mostly visible in unit tests.
@sergio-bobillier sergio-bobillier marked this pull request as ready for review February 18, 2026 15:15
@sergio-bobillier sergio-bobillier self-assigned this Feb 18, 2026
@sergio-bobillier sergio-bobillier merged commit 350e578 into master Feb 19, 2026
2 checks passed
@sergio-bobillier sergio-bobillier deleted the sb-fix-client-standalone-require branch February 19, 2026 09:16
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.

2 participants