why whole xpath syntax is placed in square brackets - selenium-chromedriver

I am executing a selenium script
there is a xpath as
//span[contains(text(),'Country')]//following::span[text()='Node']/../..//select
while executing it is failed by saying
[Chromedriver:xpath //span[contains(text(),'Country')]//following::span[text()='Node']/../..//select] Could not be found
Why this extra square bracket[] is added while execution.
If I get the print statement for same syntax it shows without square bracket[]
Can somebody please help me
why this is adding and how to resolve this

Related

I am unable to run HIVE functions in my DBeaver tool

I am trying to run some hive functinos in Dbeaver tool but it always giving the below error
What I am trying to run is for example :
SELECT from_unixtime(unix_timestamp('17-Sep-21', 'dd-MMM-yy'),'dd-MMM-yy');
error I am getting :
SQL Error [30328] [50000]: TEIID30328 Remote
org.teiid.api.exception.query.ExpressionEvaluationException
TEIID30328 Unable to evaluate timestampadd(SQL_TSI_SECOND,
unix_timestamp('17-Sep-21', 'dd-MMM-yy'), {ts'1969-12-31 19:00:00.0'})
TEIID30341 Function impala.unix_timestamp is marked in the function
metadata as a function that must be evaluated at the source.
The full stack trace should contain more information as to why it can't evaluate. Most of the later versions of Teiid even for pushdown functions will pre-evaluate them if the surrounding expression cannot be pushed.

MYSQL codes not being read

When I input a code or anything into MySQL and hit "enter" it moves down and "->" appears. It is as if the code is not going through or the code is not being read.
I have attempted to download "add-ons" but I am really not sure what I am doing. This is for school and I am having trouble getting in touch with the professor.
I am new to this and can't figure out what I am doing wrong. Please help!
Please see image of what it looks like to me.
Please add semicolon ; after the mysql code.
Problem 1: Be aware of the prompt. Either of these
MariaDB >
mysql >
means that you are inside the MySQL commandline tool. You can enter only SQL statements. Most SQL queries need to be terminated by a ; or \G (but not both). To exit that tool:
exit
Or, if you get stuck in certain ways
CTRL-C
exit
Each of these implies a shell script:
$
#
mymachine$
/usr/home/rj $
C:\Users\rj:
and many others
Problem 2: mysqldump is a command, not SQL. So it needs to be executed in a shell script.
Problem 3: There is yet another problem. When it suggested typing 'help;', it did not mean for you to include the quotes. Instead, type just help;.

Still getting error message after `except` statement dealing with `ProgrammingError`

I am using python to automatically populate a MySQL DB. The script that populates the DB (/path/to/pythonScript.py very long) is actually called by another python script (example below) works fine and I have added a few statements that prevent me from inserting duplicated entries.
When I try to insert a duplicated entry with the script /path/to/pythonScript.py I get (as expected)
ProgrammingError: 1061 (42000): Duplicate key name 'unique_index'
In order to deal with that, I want to write a try except statement while calling the /path/to/pythonScript.py script, as shown below:
import mysql.connector
from mysql.connector.errors import ProgrammingError
# Here I have already successfully connected to the DB, and populated it
try:
get_ipython().system("ipython /path/to/pythonScript.py") # this is the script that populates the DB. It does not allow the insertion of duplicated entries
except ProgrammingError:
print("a warning message informing that I am trying to insert a duplicated entry")
When I call the script for the first time, everything goes well (after all, the DB was empty). But then when I call the script for the second time (i.e. when I attempt to insert duplicated entries) I am still getting the same error ProgrammingError: 1061 (42000): Duplicate key name 'unique_index'
I have found this documentation page where they show examples on how to handle errors, though there is no example specifically on the ProgrammingError. In this other documentation page there is one example on the ProgrammingError, though they skipped the imports section and I am afraid I am missing something by the import (note that I don't get any error when I call from mysql.connector.errors import ProgrammingError)?
You are running the other script as a distinct process. Exceptions only exist within the current process - FWIW, you could be running a shell script or a C-coded binary app instead, it would be just the same.
I kindly suggest you momentarily ditch IPython and take a couple days doing the full official Python tutorial, paying particular attention to the parts about functions and modules. Then you may want to rewrite your first script to make it a proper module with proper functions (I assume from your question and example code it's currently a plain script with everything at the top-level - but I may be wrong of course ;) ), then rewrite your calling script to import functions from the first one and call them.
Also note that that ProgrammingError can happen for a whole lot of other reasons than a duplicate key, so you MUST check the exception's code to find out which exact error happened.

Excel to SQL - CEILING and Error code 1582

I have the following excel formula:
CEILING(F9*6763.85873627538/((F9-1)*400+6763.85873627538),1)
Where F9 is named PROJECTED_QUANTITY in my table sample_size_by_service_id
I have the following SQL query written out:
select
PROJECTED_QUANTITY, ceiling((PROJECTED_QUANTITY*6763.858736275380)/((PROJECTED_QUANTITY - 1)*400+6763.85873627538),1)
FROM sample_size_by_service_id
and I'm getting the following error message:
Error Code: 1582. Incorrect parameter count in the call to native
function 'ceiling' 0.047 sec
Not sure what I'm doing wrong here - I'm a novice to SQL and my hours of googling have had me make sure that my PROJECTED_QUANTITY column is an INTEGER type (it is). I suspected that I am badly badgering the combined operators, but I'm not sure how else to write it.
Appreciate any insight! Thanks!
At the suggestion of user3964075, I removed the second parameter as the mysql syntax for CEILING is CEILING(number), not CEILING(number, significance) as it is in excel. Removing the second parameter resolved the issue - I am no longer getting error code 1582 and am achieving the desired results.

What does it mean when the console displays ->?

Rookie question.
I was performing some mysql processes, and then the console displays an indented -> as in the image below, instead of the normal console prompt:
What does that mean? I can't do anything with it there.
Thank you!
Means that the sentence is not completed.
To end a sentence inside a mysql session, you have to type ;⏎.
By the way, you couldn't do a cat inside a mysql session.