-
| 
         Hello. This variant doesn't work.  | 
  
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            Pentusha
          
      
      
        Nov 23, 2022 
      
    
    Replies: 1 comment 1 reply
-
| 
         I ran into a similar problem once and solved it with additional cast from string to integer: from sqlalchemy import case, cast
from sqlalchemy.dialects.postgresql import INTEGER
cast(
    case([
        (Record.name == name, '0'),
    ], else_='1'),
    type_=INTEGER,
) | 
  
Beta Was this translation helpful? Give feedback.
                  
                    1 reply
                  
                
            
      Answer selected by
        fcennecf
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
I ran into a similar problem once and solved it with additional cast from string to integer: