Analytics API: Query for when objects are tagged? - rally

Is it possible using the Analytics API to query for when a particular type of artifact, like a defect or test case, was tagged with a particular tag?
What would the query look like?

If the ObjectID of your Tag of interest is 12345678910, then a query similar to the following should do the trick:
"_TypeHierarchy":"TestCase",
"Tags":{$in:[12345678910]},
"_PreviousValues.Tags":{$nin:[12345678910]}

Related

row-level security based on logged in user's team

Is there a way to use a big query logged in user's other attributes (example: team) to restrict the rows in a table. Currenlty we have a row level security like below where in which we are making use of the native function session_user().
Looking to see if we could get something like session_team(). A different BQ Table has the user-team mapping.
CREATE OR REPLACE ROW ACCESS POLICY example_policy
ON dataset.tablename
GRANT TO ("group:groupname-group#company.com")
FILTER USING (employee_email <> session_user())
Are you perhaps referring to this cloud.google.com/bigquery/docs/… Use case is using the session_user() function. It is similar to the query you have posted.
But for group you can review this use case that uses the region as group. Possibly can be implemented with the group that similar to your use case.
Diagram in the documentation for reference:

how to view stats on snowflake?

I am looking for a way to visualize the stats of a table in Snowflake.
The long step is to pull a meaningful sample of the data with python and apply Pandas, but it is somewhat inefficient and unsafe to pull the data out of snowflake.
Snowflake's new interface shows these stats graphically and I would like to know if there is a way to obtain this data with query or by consulting metadata.
I need something like Pandas-profiling but without a external server. maybe snowflake store metadata/statistic about its colums. numeric, categoric
https://github.com/pandas-profiling/pandas-profiling
thank you for your advices.
You can find a lot meta information in the INFORMATION_SCHEMA.
All the views and table functions in the Snowflake INFORMATION_SCHEMA can be found here: https://docs.snowflake.com/en/sql-reference/info-schema.html
not sure if you're talking about viewing the information schema as mentioned, but if you need documentation on this whole new interface, it's called SnowSight
you can learn more there:
https://docs.snowflake.com/en/user-guide/ui-snowsight.html
cheers!
The highlight in your screenshot isn't statistics about the data in the table, but merely about the query result (which looks like a DESCRIBE TABLE query). For example, if you look at type, it simply tells you that this table has 6 VARCHAR columns, 2 timestamps, and 1 number.
What you're looking for is something that is provided by most BI tools or data catalogs. I suggest you take a look at those instead.
You could also use an independent tool, like Soda, which is open source.

Is it possible to find the Wikipedia ID by property, e.g. Grid ID

Wikidata stores the Grid ID of educational institutions in property 2427 (https://www.wikidata.org/wiki/Property:P2427). Is it possible to retrieve the Wikipedia ID for a given Grid ID.
Example: I know the value "grid.1012.2" as Grid ID.
I would like to get Q1517021 back!
I tried
https://www.wikidata.org/w/api.php?action=wbgetclaims&format=json&property=P2427&claim=grid.1012.2
without success...
You can use the search API with the haswbstatement keyword (docs): action=query&format=json&list=search&srsearch=haswbstatement%3AP2427%3Dgrid.1012.2
Although as suggested by others using SPARQL might be easier for these kinds of things.

Define fields which the LIVE query in orientdb should return

I'm currently working with LIVE queries in OrientDB. Is it possible to decide which fields a 'live-update, live-insert or live-delete' event will return?
I tried a live query like this:
LIVE SELECT username, description FROM User
But it returns the whole node (record). I'm working with the NodeJS library.
for now it's not possible. Live queries yields the entire record involved in the live query

View with parameters in BigQuery

We have a set of events (kind of log) that we want to connect to get the current state. To improve performance/cost further, we would like to create snapshots (in order to not check all the events in history, but only from the last snapshot). Logs and snapshots are the tables with date suffix.
This approach works OK in the BQ, but we need to manually define the query every time. Is there any way to define 'view' with parameters (e.g. dates for the table range query)? Or any plans to do something like that?
I know that there are some topics connected with TABLE_RANGE / QUERY in views (eg Use of TABLE_DATE_RANGE function in Views). Are there any new information on this subject?
That's a great feature request - but currently not supported. Please leave more details at https://code.google.com/p/google-bigquery/issues/list, the BigQuery team takes these requests very seriously!
As a workaround i wrote a small framework to generate complex queries with help of velocity templates. Just published it at https://github.com/softkot/gbq
Now you can use Table Functions (aka table-valued functions - TVF) to achieve this. They are very similar to a view but they accept a parameter. I've tested and they really help to save a lot while keeping future queries simple, since the complexity is inside the Table Function definition. It receives a parameter that you can then use inside the query for filtering.
This example is from the documentation:
CREATE OR REPLACE TABLE FUNCTION mydataset.names_by_year(y INT64)
AS
SELECT year, name, SUM(number) AS total
FROM `bigquery-public-data.usa_names.usa_1910_current`
WHERE year = y
GROUP BY year, name
Then you just query it like this:
SELECT * FROM mydataset.names_by_year(1950)
More details can be found in the oficial documentation.
You can have a look at BigQuery scripting that have been released in beta : https://cloud.google.com/bigquery/docs/reference/standard-sql/scripting