Named query returns null for all columns, but only if run in a script

I have a named query that returns values for all columns in the query editor. If I try to run the named query in a script using system.db.runNamedQuery, it returns no rows. There are no parameters and it was working earlier today.

Is this a known bug?

select UPPER([user_id]) as racfId, 
		prsn_id, 
		last_nm as last_name, 
		frst_nm as first_name, 
		mid_init_txt as middle_initial, 
		up_case_emp_num as employee_num, 
		title_txt as title, 
		addr_txt as addr_line1, 
		ofce_txt as office_loc, 
		city_txt as addr_city, 
		st_txt as addr_state, 
		zip_cd_txt as addr_zip, 
		cntry_nm as addr_country, 
		phn_num as phone_num, 
		mobile_phn_num as cell_phone_num, 
		email_txt as email, 
		substring(unit_key_cd,1,2) as unit, 
		chrg_dept_cd as department, 
		mgr_user_id as manager 
from edl_current.people_and_org_prsninfoutf8_prsn_info_utf8


In what scope are you running the script? The arguments to system.db.runNamedQuery() vary by scope.

(I assume it works in the named query editor's testing tab.)

Do you happen to have a named query in a folder with the exact same name as a named query at the root? Strange things can occur in that case, because of a recently fixed bug.

It looks like it was the scope noted in the script. Thanks. Strange because it worked at one point and hadn't been changed as far as I could tell.

I have no idea what you mean by this. Scripts do not have a scope. Scripts run in a scope, based on what calls them.

Is there a place where I can find more info about that ?

There's not much more info than that. Remarkably, it seems to date back to 8.0.0. It's fixed in the latest nightlies and 8.1.37, I think?

It would only manifest in the specific scenario described - a queury in a folder with the same name (the last path attribute) as a query at the root.

Sorry, I mean the parameters noted in the script. The named query had no parameters so the original script was:

userDataset = system.dataset.toPyDataSet(system.db.runNamedQuery(getUsersQuery, {}))

I had to remove the empty parameter dictionary to get it to run. Not sure why.