skip to Main Content

How to check if key is in JSON sqlachemy

I am trying to select a segment if: settings dict is not null Has key user_parameters in it And user_parameters (dict) has key user_id in it Code below: user_id = '100952' select([self.db.segments]).where( and_( self.db.segments.c.settings.isnot(None), cast(self.db.segments.c.settings, JSON)["user_parameters"].as_string().contains(f"'{user_id}'"), ) ) Converting JSON…

VIEW QUESTION

Python Pandas extract csv column containing json

I want to learn Pandas framework, so I find free csv with Euro data from kaggle.com https://www.kaggle.com/datasets/piterfm/football-soccer-uefa-euro-1960-2024/data But there're plenty of columns which looks like this subset['goals'][1] "[{'phase': 'FIRST_HALF', 'time': {'minute': 7, 'second': 41}, 'international_name': 'Xavi Simons', 'club_shirt_name': 'Xavi', 'country_code':…

VIEW QUESTION

SQL Server JSON for many-to-many

I have the following tables (many-to-many): DROP TABLE IF EXISTS [dbo].[ItemOwner], [dbo].[Items], [dbo].[Owners] GO CREATE TABLE [dbo].[Items] ( [Id] [int] IDENTITY(1,1) PRIMARY KEY CLUSTERED, [Name] [varchar](max) NOT NULL ); CREATE TABLE [dbo].[Owners] ( [Id] [int] IDENTITY(1,1) PRIMARY KEY CLUSTERED, [Name]…

VIEW QUESTION
Back To Top
Search