Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Questions re: "Multi-model with SAP HANA Cloud" developer challenge

Vitaliy-R
Developer Advocate
Developer Advocate
4,998

This discussion thread is for you to ask your questions and discuss issues if you are participating in the June 2024 developer challenge. The topic is "Multi-model processing with SAP HANA and Python in SAP Business Application Studio."

Please use separate discussions created for the submission of your solutions. Keep this thread for your questions only.

82 REPLIES 82

0 Kudos
1,444

@SushmitaG @Alpesa1990 The kernel selection is not defined in the profile but in the workspace setting.You need to open the workspace file https://github.com/SAP-samples/sap-community-developer-challenge-hana-multimodel/blob/main/sap-commu...

as described in step 4 of https://github.com/SAP-samples/sap-community-developer-challenge-hana-multimodel/blob/main/challenge...

Please let me know if this helps.

SushmitaG
Product and Topic Expert
Product and Topic Expert
1,378

Hi @Alpesa1990 , Its working for me now. I re-installed ipykernel  and it worked now.

Regards,

Sushmita

 

DirkO
Participant
1,450

Hello all,

I like this dev challenge and how it is set up. Its among only a few SAP tutorials/challenges where I can see and learn how topics are working.  Also the hints outside of the topics e.g. to DJ Adams I really appreciate.

I had a panic attac when looking after the data import into the table but did not find any records in at all. 🙂 Usually I dump data from a dataframe to a hana table and the need to commit the transactions I haven´t had on my plate.

Note, that the statement above is not commiting the transaction and records are not visible for other processes in the database table unless the below connection commit is executed.

Also interessting to see the different representation of the values caused by the tool used to display.

DBeaver

BAS

 
DirkO_3-1718475359474.png
 
DirkO_4-1718475367748.png

Which makes also clear why it is highlighted ''Note the use of the [`TO_NVARCHAR()]''

DirkO_5-1718475414699.png

Br.,

DirkO

 

Vitaliy-R
Developer Advocate
Developer Advocate
0 Kudos
1,440

Vectors are stored in the binary format, and indeed, different tools display bytes of those binary values in different ways. TO_NVARCHAR() converts them to human-readable real numbers-looking string.

I separated COMMIT into a separate statement because then loading the original dataset with 3 million records takes about 20 minutes and the commit is a fraction of a second. That allows for avoiding delayed load time with intermediate commits and for avoiding a partial result loaded in the case of the INSERT failure for any reason.

Have a good weekend!

DirkO
Participant
1,450

Hello Witalij,

I´m facing one issue with the  profile settings from "HANAwPy".

Is it a feature, a bug or me that I´m loosing the settings with every restart of the BAS?

DirkO_0-1718476714946.png

My understanding was that I have to import this only once.

Thanks for taking some time to look into this.

Br.,

DirkO

Vitaliy-R
Developer Advocate
Developer Advocate
0 Kudos
1,385

Hi, @DirkO  Is it possible that you are running BAS in incognito mode, when the new profile disappears? 

1,350

Hi!

I faced to the same problem. Not use the incognito mode.

Regards,

1,063

Hi @Vitaliy-R,

many thanks for your response and taking time to look into this. Issue still persists and incognito mode is not in use.

But it is probably because of FireFox because Chromium does not work at all for the challenge.

Thanks & have a nice weekend.

Br.,

DirkO

 

 

 

gphadnis2000
Participant
0 Kudos
1,328

Hi Vitaliy,

Getting below error.I have installed module it says requirement satisfied.

gphadnis2000_0-1718872563269.png

 

0 Kudos
1,327

Make sure you have `pillow` package installed in the virtual environment `.venv` and that `.venv` is the kernel you are using to run the notebook.

0 Kudos
1,327

I have installed in virtual environment '.venv' still system is throwing error saying Module not found.

1,129

Hi @gphadnis2000 

First: source ~/projects/.venv/bin/activate

Then try running this command again "pip install --require-virtualenv tensorflow-cpu ipywidgets pillow" in .venv. I got the same error then I ran it again and it worked

satyasundar3
Explorer
0 Kudos
1,294

Hi @Vitaliy-R ,
I am getting the below error in Week-3. Can you please help me here ? 

satyasundar3_0-1718892727574.png

 

1,269

Yes, it is one of the errors I introduced in the notebook to challenge you 🤓

Please check the part of connecting to the HANA db with the previous week. Give it another try to resolve it! If you won't be able to find the root cause of the issue, then let me know, and I will help you.

0 Kudos
972

Hi @Vitaliy-R ,

I was able to resolve the previous error.

But now I am getting the below error while inserting into the table.

satyasundar3_0-1719224668040.png

@Cocquerel if you have some time, can you kindly help here ? I am pretty new to this Python world.

962

There is something missing in the INSERT statement. Look at previous week.

0 Kudos
954

Welcome to the Python 🐍 World @satyasundar3 

It is one of the errors that I introduced, but as @Cocquerel  has replied already, you should be able to find it by comparing it to the previous week's notebook.

moh_ali_square
Participant
0 Kudos
1,237

Hi @Vitaliy-R ,

I am trying to fix the typo in week3_2 (Closest neighbours section). I fixed the cosine similarity, but for the row_number, I am trying but without sucess yet. 

Error_SQL _Row_number.png

Here below the complete SQL statement, I tried to (WHERE "B"."row_num" = {random_record}) but it did not work.

I checked previous week SQL statement, but I was able to fix the cosine_similarity function only.

SQL statement.png

Thanks in Advance. 

1,227

Hi Moh

You almost have it 🙂   Just check how other columns are espressed: "tablename"."column"  

0 Kudos
1,125

Thanks @raulruiz for your reply. 

I fixed the error, but now I don't have results from my query. Any idea why?

Thanks in Advance.

Error_SQL_noBreed.png

0 Kudos
1,059

Can you include a screenshot that would include the complete current cell (with the SQL statement) and the previous cell (with the random number generation)?

0 Kudos
1,003

Here is the complete current cell and random number generator.

Thanks in advance.

week3_random_record.pngweek3_SQL.png

969

It seems you have added some additional partitioning in your SQL statement, so it is not getting row numbers for the whole table but for smaller partitions.

Could you restore it to

INNER JOIN 
  (SELECT 
     ROW_NUMBER() OVER () AS "row_num", *
   FROM {source_table}
  ) AS "B" 

and then re-run the cell?

mwn
Participant
0 Kudos
1,212

With the week 3 queries challenge notebook, the cell

import os

wouldn't execute. In fact, the word "import" wasn't coloured purple, as it was with the week 3 import workbook.

My workaround was to include it in the next cell.

Weird!

Cocquerel
Active Contributor
1,211

It was a malicious typo from Vitaliy.
The cell type was defined as "Raw". You just had to switch to python instead.

Cocquerel_0-1718981573975.png

 

1,207

I liked it! I was struggeling to know what was failing and when I noticed that... evil typo!

1,185

Thanks.

i should have noticed that, and also wondered why there was no indication of the elapsed run time when I tried to execute the cell.

gphadnis2000
Participant

1,059

Hi @gphadnis2000 Yes, it is one of the errors I introduced into the challenge for you to find the root cause and resolve 🤓

1,056

i was able to identify error and proceed with week3 submission

moh_ali_square
Participant
0 Kudos
871

Hi,

Week 4_2: shortest path string

I have an error, I am trying to figure it out, but it looks I need a hint 😬

Thanks in advance. 

Error_dfg_shotest_path_string.png

0 Kudos
863

Hmmm... I do not think this is the code where I introduced any typo, so can you please check the results of:

hdf_routes_strings
.filter('ID IN ('+path_airport1_to_airport2_hops.edges.ID.astype(str).str.cat(sep=',')+')')
.agg([('ST_CollectAggr', 'LINE', 'LINE_PATH')])
.select_statement

and

myconn.sql(
hdf_routes_strings
.filter('ID IN ('+path_airport1_to_airport2_hops.edges.ID.astype(str).str.cat(sep=',')+')')
.agg([('ST_CollectAggr', 'LINE', 'LINE_PATH')])
.select_statement).collect()

789

Thanks for the hint.

I got it, but it needs to review the syntix to  find "OLD" and change it. 🔍

sabarna17
Contributor
0 Kudos
725

I am facing a strange issue. From Week3_1, here the execution is stuck for almost several minutes and after that nothing executes. Not able to understand what's wrong.

sabarna17_2-1719866364952.png

After this, nothing executes not even print('Hello BAS') - 

sabarna17_3-1719866497938.png

 

 

Vitaliy-R
Developer Advocate
Developer Advocate
0 Kudos
692

What do you see in the Output...

VitaliyR_0-1719913336648.png

...and then check output for Jupyter selection:

VitaliyR_1-1719915619821.png

Do you get any errors there?

678

It was giving some error in console after the steps you suggested which I tried out earlier.

Actually, I deleted the BAS instance and created a new one. I cannot see this error again.

Thank you. 

SushmitaG
Product and Topic Expert
Product and Topic Expert
0 Kudos
678

Hi @Vitaliy-R,

Week 4 challenge is too challenging too resolve.. I will be grateful if someone can provide me a hint...

Initially got the below errorScreenshot 2024-07-02 at 3.39.09 PM.png

Then to fix this error, declared variable 

table_structure_ports but still getting error, is this approach correct?
Screenshot 2024-07-02 at 4.28.52 PM.png
Regards,
Sushmita

661

Totally agreed. It's getting complex in each step to find these errors.

Just came across this one. I executed - .get_table_structure(). As this was written in the comments.

sabarna17_1-1719921170879.png

 

SushmitaG
Product and Topic Expert
Product and Topic Expert
0 Kudos
660

Lucky you...you are able to execute the statement